VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   375
      Left            =   3000
      TabIndex        =   0
      Top             =   2760
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
  Dim a(), Key%, i%, j%
  a = Array(1, 6, 8, 3, 5, 9, 10, 2, 7, 4)
  Key = Val(InputBox("输入要删除的值"))
  For i = LBound(a) To UBound(a)
    If Key = a(i) Then
      For j = i + 1 To UBound(a)
        a(j - 1) = a(j)
      Next j
      ReDim Preserve a(LBound(a) To UBound(a) - 1)
      Print "删除完成"
      Exit Sub
    End If
  Next i
  Print "找不到要删除的元素"
End Sub

