Skip to content

Commit 9a7cf12

Browse files
committed
Update VBAexpressions.cls
1 parent 7d1be28 commit 9a7cf12

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/VBAexpressions.cls

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,20 +1405,6 @@ Private Function GetEvalToken(ByRef Expression As String) As Token
14051405
End If
14061406
End Function
14071407

1408-
Private Function ValidFuntionName(ByRef Expression As String, _
1409-
ByRef FuntionName As String, _
1410-
StartPos As Long) As Boolean
1411-
Dim cLeft As Boolean
1412-
Dim cRight As Boolean
1413-
1414-
If StartPos > 1 Then
1415-
cLeft = Not IsLetter(MidB$(Expression, StartPos - 2, 2))
1416-
Else
1417-
cLeft = True
1418-
End If
1419-
cRight = Not IsLetter(MidB$(Expression, StartPos + LenB(FuntionName), 2))
1420-
ValidFuntionName = cLeft And cRight
1421-
End Function
14221408
Private Function GetFunctionName(ByRef Expression As String) As String
14231409
Dim EFjCounter As Long
14241410
Dim GFNbool As Boolean
@@ -1443,7 +1429,7 @@ Private Function GetFunctionName(ByRef Expression As String) As String
14431429
For i = 0 To UserDefFunctions.Index
14441430
tmpPos = InStrB(1, ExpCopy, UserDefFunctions.Storage(i).name)
14451431
If tmpPos Then
1446-
GFNbool = GFNbool = ValidFuntionName(ExpCopy, UserDefFunctions.Storage(i).name, tmpPos)
1432+
GFNbool = ValidFuntionName(ExpCopy, UserDefFunctions.Storage(i).name, tmpPos)
14471433
If GFNbool Then
14481434
Exit For
14491435
End If
@@ -2636,6 +2622,21 @@ Private Function UnicToken(ByRef Source() As String, ByRef value As String) As B
26362622
UnicToken = Not tmpResult
26372623
End Function
26382624

2625+
Private Function ValidFuntionName(ByRef Expression As String, _
2626+
ByRef FuntionName As String, _
2627+
StartPos As Long) As Boolean
2628+
Dim cLeft As Boolean
2629+
Dim cRight As Boolean
2630+
2631+
If StartPos > 1 Then
2632+
cLeft = Not IsLetter(MidB$(Expression, StartPos - 2, 2))
2633+
Else
2634+
cLeft = True
2635+
End If
2636+
cRight = Not IsLetter(MidB$(Expression, StartPos + LenB(FuntionName), 2))
2637+
ValidFuntionName = cLeft And cRight
2638+
End Function
2639+
26392640
Private Function ValidTree() As Boolean
26402641
Dim B As Long
26412642
Dim c As Long

0 commit comments

Comments
 (0)