⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clsstack.cls

📁 编译原理课程设计用vb编写
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsStack"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private s As New Collection


Public Sub Push(ByVal Item As Variant)
    If s.Count = 0 Then
        s.Add Item
    Else
        s.Add Item, , 1
    End If
End Sub

Public Function Pop()
    t = s.Item(1)
    s.Remove 1
    Pop = t
End Function

Public Function Clear()
    While s.Count > 0
        s.Remove 1
    Wend
End Function

Public Property Get Count() As Variant
    Count = s.Count
End Property

Public Property Let Count(ByVal vNewValue As Variant)
    
End Property

Public Property Get Item(ByVal i As Integer) As Variant
    '从0开始,不是从1开始,注意注意~~~
    Item = s.Item(i + 1)
End Property

Public Property Let Item(ByVal i As Integer, ByVal vNewValue As Variant)
End Property

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -