Option Explicit
Function Delete3(Arr As Variant) As Variant
Dim i As Integer
For i = LBound(Arr) To UBound(Arr)
If i > UBound(Arr) Then Exit For
If Arr(i) = 3 Then
Do
Dim j As Integer
For j = i To UBound(Arr) - 1
Arr(j) = Arr(j + 1)
Next j
If LBound(Arr) = UBound(Arr) Then
Delete3 = Empty
Exit Function
End If
ReDim Preserve Arr(LBound(Arr) To UBound(Arr) - 1)
If i > UBound(Arr) Then Exit For
Loop While Arr(i) = 3
End If
Next i
Delete3 = Arr
End Function
Sub Test()
Delete3 (Array(3, 3, 3, 3, 1, 3, 7, 3, 3, 3, 9, 3, 3))
Delete3 (Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3))
Delete3 (Array(1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3))
Delete3 (Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1))
End Sub
Ç°Õó×ÓдÁËÒ»¸öĿ¼Ãû/ÎļþÃûµÄ»ñȡС³ÌÐò£¬ÕâÁ½Ìì¾ÓÈ»ÓÖ±»Ãû³ÆÅúÁ¿ÐÞ¸ÄÂé·³ÁËһϣ¬ËùÒÔÔÙдһ¸ö°É¡£
×¢Ò⣺ÄãÒªÊÇÖ»Ïëдһ´ÎµÄ»°£¬ÓÃÅú´¦Àí¸ü·½±ã¡£Ö»Óжà´ÎʹÓõÄÇé¿öÏ£¬×Ô¼ºÐ´³ÌÐò²ÅÓÐÒâÒå¡£
VBÖнøÐÐÃû³ÆÐ޸ĺÜÈÝÒ×,Óõ½µÄ¾ÍÊÇNameÕâ¸öº¯Êý£¬Ó÷¨ÈçÏ£º
Name OldName As NewName£¬Ëü²»½ö¿ÉÒÔ¸ÄдÃû³Æ£¬¶øÇÒ¿ÉÒÔ¸ü¸ ......
ºÜ¾ÃÒÔÇ°µÄÒ»¸ö´úÂëÁË¡£¡£¡£¡£¡£ÄÇʱ»¹³ÁÃÔÓÚÑо¿WindowsXPµÇ¼ÃÜÂëµÄ¼ÆËã·½·¨¡£¡£¡£¡£
ÏÈн¨Ò»¸öVB¹¤³Ì£¬»Ò»¸öCommandButton£¬¸ÄÃûΪcmdGetSYSKEY£¬»Ò»¸öTextBox£¬¸ÄÃûΪtxtSYSKEY£¬È»ºóÕ³ÌùÏÂÃæµÄ´úÂ룬ÔËÐм´¿É£¬ÔÚWindowsXP SP2 Build 2600 + VB6.0 SP6ϲâÊÔͨ¹ý£¬»ñµÃµÄSYSKEYÓëCain&Abel v4.9.6Ò»Ö¡£¡£¡£¡£ ......