Skip to content

Commit

Permalink
* Fixed subtraction problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulover committed Oct 8, 2020
1 parent e1785f8 commit 0b82a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Eval.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ ExprCompile(e)
ExprEval(e,lp,eo,el)
{
c1:=Chr(1)
While (RegExMatch(e,c1 "l-[\d\.]++(?!" c1 "o)"))
e:=RegExReplace(e,c1 "l-([\d\.]+)",c1 "l$1" c1 "o-")
Loop,Parse,e,%c1%
{
lf:=A_LoopField,tt:=SubStr(lf,1,1),t:=SubStr(lf,2)
Expand Down
2 changes: 1 addition & 1 deletion Examples/EvalExamples.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MsgBox, 1, Operators, % "Expression: `n`n" Expression "`n`n`nResults:`n`n" r
IfMsgBox, Cancel, ExitApp

; Variable Assignment
Expression := "VarA := 123,VarB := VarA - 23,VarX := ""First,Second,Third,Fourth"""
Expression := "A := 100, B := A - 5 - 10 - 15, B, VarA := 123,VarB := VarA - 23,VarX := ""First,Second,Third,Fourth"""
Result := Eval(Expression)
r := StrJoin(Result, "`n")
MsgBox, 1, Variable Assignment, % "Expression: `n`n" Expression "`n`n`nResults:`n`n" r
Expand Down

0 comments on commit 0b82a7c

Please sign in to comment.