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 = 495
Left = 1800
TabIndex = 0
Top = 1320
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'
Dim cStack As clsStack
Dim i As Long
Set cStack = New clsStack
' ---------------------------------------------------------------------------------------------------
Debug.Print "String Data: "
For i = 65 To 90
cStack.Push Chr(i)
Next i
Debug.Print "Peek:"; cStack.Peek
Debug.Print "Stack Data Count"; cStack.StackDataCount
For i = 1 To cStack.StackDataCount
Debug.Print cStack.Pop
Next i
Debug.Print
' ---------------------------------------------------------------------------------------------------
Debug.Print "Long Data: "
cStack.Clear
For i = 1 To 20
cStack.PushLong i
Next i
D