Skip to content

Commit

Permalink
* Fixed *A_* variables not accessible in nested Loop commands.
Browse files Browse the repository at this point in the history
* Fixed bugs with quotes in expressions.
  • Loading branch information
Pulover committed Nov 23, 2020
1 parent 12e0dca commit 27e0d28
Show file tree
Hide file tree
Showing 8 changed files with 495 additions and 487 deletions.
6 changes: 5 additions & 1 deletion Documentation/About.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Author: Pulover \[Rodolfo U. Batista\]
Copyright © 2012-2020 Rodolfo U. Batista

Version: 5.3.6
Version: 5.3.7
Release Date: November, 2020
AutoHotkey Version: 1.1.32.00

Expand Down Expand Up @@ -38,6 +38,10 @@ chosen1ft for suggestions and testing.

# Change Log

## Version 5.3.7
* Fixed *A_* variables not accessible in nested Loop commands.
* Fixed bugs with quotes in expressions.

## Version 5.3.6
* Fixed bug with multiple compare operators.
* Fixed issue with variables and strings in expressions.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/MacroCreator_Help.ahk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
Library: Pulover's Macro Creator
# Version: 5.3.6
# Version: 5.3.7
[www.macrocreator.com](https://www.macrocreator.com)
[Forum](https://www.autohotkey.com/boards/viewforum.php?f=63)
Expand Down
10 changes: 6 additions & 4 deletions LIB/Eval.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Eval($x, _CustomVars := "", _Init := true)
local $y, $z, $i, $v, _Elements, o_Elements, __Elements, HidString, RepString, $o
, _Match, _Match1, _Match2, _Match3, _Match4, $pd, $pd1, EvalResult
, ObjName, VarName, Oper, VarValue, _Pos, _i, _v, $Result
Static _Objects
Static _Objects, $Quote := Chr(2)
_Elements := {}
If (_Init)
_Objects := {}
Expand Down Expand Up @@ -114,7 +114,7 @@ Eval($x, _CustomVars := "", _Init := true)
_Objects[ObjName] := $y
Else If $y is not Number
{
$y := """" StrReplace($y, """", """""") """"
$y := """" StrReplace($y, """", $Quote) """"
, HidString := "&_String" (ObjCount(_Elements) + 1) "_&"
, _Elements[HidString] := $y
, $y := HidString
Expand Down Expand Up @@ -184,7 +184,7 @@ Eval($x, _CustomVars := "", _Init := true)
{
If (_oMatch[_i] != "")
{
_v := """" _v """"
_v := """" StrReplace(_v, """", $Quote) """"
, HidString := "&_String" (ObjCount(_Elements) + 1) "_&"
, _Elements[HidString] := _v
, _v := HidString
Expand Down Expand Up @@ -255,7 +255,7 @@ Eval($x, _CustomVars := "", _Init := true)
_Objects[ObjName] := $y
Else If $y is not Number
{
$y := """" $y """"
$y := """" StrReplace($y, """", $Quote) """"
, HidString := "&_String" (ObjCount(_Elements) + 1) "_&"
, _Elements[HidString] := $y
, $y := HidString
Expand Down Expand Up @@ -465,6 +465,7 @@ AssignParse(String, ByRef VarName, ByRef Oper, ByRef VarValue)

StrJoin(InputArray, JChr := "", Quote := false, Init := true, Unquote := false)
{
static $Quote := Chr(2)
For i, v in InputArray
{
If (IsObject(v))
Expand All @@ -478,6 +479,7 @@ StrJoin(InputArray, JChr := "", Quote := false, Init := true, Unquote := false)
If (Unquote)
While (RegExMatch(v, """{2}"))
v := RegExReplace(v, """{2}", """")
v := StrReplace(v, $Quote, """")
}
JoinedStr .= v . JChr
}
Expand Down
20 changes: 10 additions & 10 deletions LIB/Playback.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,6 @@
, PlaybackVars[LoopDepth][mLoopIndex, "ErrorLevel"] := FlowControl.ErrorLevel
, LoopCount[LoopDepth] := ""

If Type not in %cType45%,%cType51%
{
For _each, _value in Pars
{
CheckVars(CustomVars, _value)
, Pars[_each] := _value
}
}

For _depth, _pair in PlaybackVars
{
If (_depth = LoopDepth)
Expand All @@ -509,7 +500,16 @@
For _each, _value in PlaybackVars[LoopDepth - 1]
PlaybackVars[LoopDepth][_each, _index] := _point
}


If Type not in %cType45%,%cType51%
{
For _each, _value in Pars
{
CheckVars(PlaybackVars[LoopDepth][mLoopIndex], _value)
, Pars[_each] := _value
}
}

Switch Type
{
Case cType38:
Expand Down
Loading

0 comments on commit 27e0d28

Please sign in to comment.