57 lines
1.3 KiB
OpenEdge ABL
57 lines
1.3 KiB
OpenEdge ABL
VERSION 1.0 CLASS
|
|
BEGIN
|
|
MultiUse = -1 'True
|
|
END
|
|
Attribute VB_Name = "DB_Data_sample"
|
|
Attribute VB_GlobalNameSpace = False
|
|
Attribute VB_Creatable = False
|
|
Attribute VB_PredeclaredId = False
|
|
Attribute VB_Exposed = False
|
|
Option Explicit
|
|
|
|
Private data_ As Excel.Worksheet
|
|
|
|
Public Function Init(target As Excel.Worksheet)
|
|
Set data_ = target
|
|
End Function
|
|
|
|
Public Property Get Count() As Long
|
|
Count = ILast.row_ - IBegin.row_ + 1
|
|
End Property
|
|
|
|
Public Function IBegin() As IteratorWorker
|
|
Set IBegin = New IteratorWorker
|
|
Call IBegin.Init(data_)
|
|
End Function
|
|
|
|
Public Function ILast() As IteratorWorker
|
|
Set ILast = New IteratorWorker
|
|
Call ILast.Init(data_)
|
|
Call ILast.GoLast
|
|
End Function
|
|
|
|
Public Function INew() As IteratorWorker
|
|
Set INew = New IteratorWorker
|
|
Call INew.Init(data_)
|
|
Call INew.GoLast
|
|
Call INew.Increment
|
|
End Function
|
|
|
|
Public Function Clear()
|
|
Call data_.UsedRange.Offset(1).ClearContents
|
|
End Function
|
|
|
|
Public Function Contains(sWorkerID$) As Boolean
|
|
Contains = Not Access(sWorkerID) Is Nothing
|
|
End Function
|
|
|
|
Public Function Access(sWorkerID$) As IteratorWorker
|
|
Dim iWorker As IteratorWorker: Set iWorker = IBegin
|
|
Do While Not iWorker.IsDone
|
|
If iWorker.WorkerID = sWorkerID Then
|
|
Set Access = iWorker
|
|
Exit Function
|
|
End If
|
|
Call iWorker.Increment
|
|
Loop
|
|
End Function |