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_Instance"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private m_bRaiseEventWhenFinished As Boolean
Private m_sExpression As String
Private m_sGUID As String

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

Public Property Get RaiseEventWhenFinished() As Boolean
    RaiseEventWhenFinished = m_bRaiseEventWhenFinished
End Property
Public Property Let RaiseEventWhenFinished(bNewVal As Boolean)
    m_bRaiseEventWhenFinished = bNewVal
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 Property Get Expression() As String
    Expression = m_sExpression
End Property
Public Property Let Expression(sNewExpression As String)
    m_sExpression = sNewExpression
End Property

Public Function Advance(oInterpreter As clsFI_Interpreter, Optional nNumOfLines As Long = -1) As Boolean

    On Error GoTo ErrorHandler

    Dim bFinished As Boolean
    
    Expression = oInterpreter.Run(Expression, nNumOfLines, bFinished)
    Advance = bFinished
    
    Exit Function
ErrorHandler:
    Call Err.Raise(Err.Number, GUID, Err.Description)
    
End Function
