Jump to content

How to represent a variable with a string


Recommended Posts

  • 1 year later...
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...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...