VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "classScriptDefines"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' Script pre-compiler defines class. '

Option Explicit

Private Source() As String
Private Dest() As String
Public Count As Long

Public Sub Initialize()
    ReDim Source(0)
    ReDim Dest(0)
    Count = -1
End Sub

Public Sub Add(SourceDef As String, DestDef As String)
    Count = Count + 1
    ReDim Preserve Source(Count)
    ReDim Preserve Dest(Count)
    Source(Count) = SourceDef
    Dest(Count) = DestDef
End Sub

Public Sub Remove(SourceDef As String)
    Dim Index As Long, i As Long
    Dim Flag As Boolean
    
    Flag = False
    For Index = 0 To UBound(Source)
        If SourceDef = Source(Index) Then
            Flag = True
            Exit For
        End If
    Next
    
    If Flag Then
        For i = Index To UBound(Source) - 1
            Source(i) = Source(i + 1)
        Next
        If UBound(Source) = 0 Then
            Initialize
        Else
            ReDim Preserve Source(UBound(Source) - 1)
            Count = Count - 1
        End If
    End If
End Sub

Public Function Find(SourceDef As String) As Long
    Dim Index As Long
    
    Find = -1
    For Index = 0 To UBound(Source)
        If SourceDef = Source(Index) Then
            Find = Index
            Exit For
        End If
    Next
End Function
