VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsFI_Functions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private m_oFunctions As New Collection

Private m_sGUID As String

Public Sub RemoveFunction(sGUID As String)
    Call Col.Remove(sGUID)
End Sub

Public Function FindFunction(sName As String) As clsFI_Function
    
    Dim oLoopFunction As clsFI_Function
    
    For Each oLoopFunction In Col
    
        If UCase(sName) = UCase(oLoopFunction.Name) Then
            Set FindFunction = oLoopFunction
            Exit Function
        End If
    
    Next oLoopFunction
    
    Set FindFunction = Nothing
    
End Function

Public Property Get Col() As Collection
    Set Col = m_oFunctions
End Property

Public Property Get GUID() As String
    GUID = m_sGUID
End Property
Public Property Let GUID(sNewGUID As String)
    m_sGUID = sNewGUID
End Property

Public Sub AddFunction(oFunction As clsFI_Function)
    Call m_oFunctions.Add(oFunction, oFunction.GUID)
End Sub

Private Sub Class_Initialize()
    GUID = GetGUID("Functions")
End Sub

Public Function GetFunctionByGUID(sGUID As String) As clsFI_Function
    Dim i As Long
    For i = 1 To m_oFunctions.Count
        If m_oFunctions(i).GUID = sGUID Then
            Set GetFunctionByGUID = m_oFunctions(sGUID)
        End If
    Next i
End Function
