$Fu = "World!"
$Bar = "Fu"
$Fubar = "Hello " & Execute("$"&$Bar)
Here's a function that will convert all variables and macros in a string into their stored values.
Func ParseMacros($Str)
Global
Local $Macros = StringRegExp($Str,"([\$\@]\w+)",3)
If Not @error Then
For $i=0 to UBound($Macros) - 1 step 1
$Str = StringRegExpReplace($Str,"\"&$Macros[$i],StringReplace(Execute($Macros[$i]),"\","\\"))
Next
EndIf
Return $Str
EndFunc
ParseMacros("Hello $Fu")
No comments:
Post a Comment