Skip to content

Commit e98788b

Browse files
committed
v3.2.4
1 parent 561989d commit e98788b

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

src/LO Basic/VBAExpressionsLib/UDFunctions.xba

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,12 @@ Public Function Concat(List As Variant) As String
7171
Next i
7272
Concat = Apostrophe & tmpResult & Apostrophe
7373
End Function
74+
Public Function SimpleProduct(ByRef aValues As Variant) As Double
75+
Dim firstNumber As Double
76+
Dim secondNumber As Double
77+
78+
firstNumber = CDbl(aValues(LBound(aValues)))
79+
secondNumber = CDbl(aValues(UBound(aValues)))
80+
SimpleProduct = firstNumber * secondNumber
81+
End Function
7482
</script:module>

src/LO Basic/VBAExpressionsLib/VBAcallBack.xba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ option ClassModule
3333
&apos;@--------------------------------------------------------------------
3434
&apos; Expose functions defined in the UDFunctions.cls
3535
Public UserDefFunctions As New UDFunctions
36-
36+
Public SimpleMath As New clsSimpleMath
3737
</script:module>

src/LO Basic/VBAExpressionsLib/VBAexpressions.xba

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4747,8 +4747,13 @@ Private Sub GetTokenStart(ByRef expression As String, ByRef startIndex As Long,
47474747
Else
47484748
If outLng &gt;= 3 Then
47494749
If AscW(strVBA.MidB(expression, outLng - 2, 2)) = 69 Then &apos;Ignore Sci notation &quot;E&quot;
4750-
outLng = outLng - 4
4751-
curChar = strVBA.MidB(expression, outLng, 2)
4750+
If outLng &gt; 4 Then
4751+
curChar = strVBA.MidB(expression, outLng - 4, 2)
4752+
Select Case AscW(curChar) &apos;Previous char must be numeric: #E[+-]#
4753+
Case 48 To 57
4754+
outLng = outLng - 4
4755+
End Select
4756+
End If
47524757
End If
47534758
End If
47544759
End If

src/LO Basic/VBAExpressionsLib/script.xlb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
<library:element library:name="VBAexpressions"/>
88
<library:element library:name="VBAcallBack"/>
99
<library:element library:name="UDFunctions"/>
10+
<library:element library:name="clsSimpleMath"/>
1011
</library:library>

src/VBAexpressions.cls

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,8 +4629,13 @@ Private Sub GetTokenStart(ByRef expression As String, ByRef startIndex As Long,
46294629
Else
46304630
If outLng >= 3 Then
46314631
If AscW(MidB$(expression, outLng - 2, 2)) = 69 Then 'Ignore Sci notation "E"
4632-
outLng = outLng - 4
4633-
curChar = MidB$(expression, outLng, 2)
4632+
If outLng > 4 Then
4633+
curChar = MidB$(expression, outLng - 4, 2)
4634+
Select Case AscW(curChar) 'Previous char must be numeric: #E[+-]#
4635+
Case 48 To 57
4636+
outLng = outLng - 4
4637+
End Select
4638+
End If
46344639
End If
46354640
End If
46364641
End If

0 commit comments

Comments
 (0)