Skip to content

Commit ed717ee

Browse files
committed
Update VBAexpressions.cls
1 parent 5456f30 commit ed717ee

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/VBAexpressions.cls

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ err_Handler:
599599
BuildErrMessage errEvalError, d_lCurly & fName & d_rCurly & " | Error#: " & err.Number & d_Space & _
600600
d_lParenthesis & err.Description & d_rParenthesis
601601
End Function
602-
602+
'#############################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####################################################################
603+
'#############################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####################################################################
603604
''' <summary>
604605
''' Returns an array containing two elements: assignments and expression to be evaluated.
605606
''' The expression to be evaluated must comply with the premise that all assignments are made
@@ -696,7 +697,24 @@ Private Function AbstractValidate(strAssignments As String) As Boolean
696697
Loop While i <= L And tmpResult
697698
AbstractValidate = tmpResult
698699
End Function
699-
700+
''' <summary>
701+
''' Returns an array containing all lines from a given ASF script file.
702+
''' </summary>
703+
Public Function ReadASFfile(filePath As String) As String()
704+
Dim FileHandled As Long
705+
Dim fLen As Long
706+
Dim Buffer As String
707+
708+
FileHandled = FreeFile
709+
Open filePath For Binary As #FileHandled
710+
fLen = LOF(FileHandled)
711+
Buffer = Space$(fLen)
712+
Get #FileHandled, , Buffer
713+
Close #FileHandled
714+
ReadASFfile = Split(Replace(Trim(Buffer), vbCr, vbNullString), vbLf)
715+
End Function
716+
'#############################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####################################################################
717+
'#############################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%####################################################################
700718
Private Function aCeiling(ByRef expression As String, ByRef fName As String) As String
701719
On Error GoTo err_Handler
702720
aCeiling = CStr(Ceiling(CDbl(expression)))

0 commit comments

Comments
 (0)