Letraindusoir Posted October 11, 2019 Author Posted October 11, 2019 local $sString="" $sString=string(12345679*9) P("$sString$") func P($Var) ConsoleWrite(StringTrimRight($Var,1) & "=[") Opt("ExpandVarStrings", 1) ConsoleWrite($Var & "]" & @CRLF) Opt("ExpandVarStrings", 0) endfunc In this way, the effect is completely achieved.
JockoDundee Posted November 16, 2020 Posted November 16, 2020 On 10/10/2019 at 8:49 PM, Letraindusoir said: local $sString="" $sString=string(12345679*9) P("$sString$") func P($Var) ConsoleWrite(StringTrimRight($Var,1) & "=[") Opt("ExpandVarStrings", 1) ConsoleWrite($Var & "]" & @CRLF) Opt("ExpandVarStrings", 0) endfunc In this way, the effect is completely achieved. Except that it only works on global variables - that Local $sString is not actually local, since it is defined outside of any function. If the ExpandVarStrings gets a true local variable label it will be too late to track down its value. Maybe the ExpandVarStrings could be enabled and disabled before the P function, though the effects this may cause could be undesirable for some. Another way is using the PreEx() function, shown in the thread below. (For some reason, I didn’t find your thread before asking a question myself) Code hard, but don’t hard code...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now