Code: Select all
MsgBox, %foo%, %bar%
Code: Select all
Log(...)
...
Log(val) {
global LOG_LEVEL
If LOG_LEVEL
MsgBox, %val%
}
I've had to do this previously with ugly workaround
Code: Select all
output = %foo%, %bar%
Log(output)
Code: Select all
MsgBox, %foo%, %bar%
Code: Select all
Log(...)
...
Log(val) {
global LOG_LEVEL
If LOG_LEVEL
MsgBox, %val%
}
Code: Select all
output = %foo%, %bar%
Log(output)
Code: Select all
Log(foo . "`," . bar)
Thank you. For now I'm trying to avoid this if possible. Is there no way to save % expressions in their current state? I've intended to just replace MsgBox/ToolTip strings with Log via regexps.Xtra wrote:Code: Select all
Log(foo . "`," . bar)
Code: Select all
Log(foo,bar)
...
Log(val1,val2) {
global LOG_LEVEL
If LOG_LEVEL
MsgBox, %val1% %val2%
}
commands such as MsgBox don't accept expressions unless you specifically FORCE an expression. your current code doesn't use expressions, it uses literal text in which variables are de-referenced via %%sdotm wrote:Thank you. For now I'm trying to avoid this if possible. Is there no way to save % expressions in their current state? I've intended to just replace MsgBox/ToolTip strings with Log via regexps.Xtra wrote:Code: Select all
Log(foo . "`," . bar)
Code: Select all
MsgBox, %foo% and %bar% ; literal text
MsgBox, % foo . " and " . bar ; forced expression parameter
Code: Select all
Log(foo . " and " . bar)
Code: Select all
Log, %foo% and %bar%
Log(param)
{
MsgBox, %param%
}
Users browsing this forum: No registered users and 81 guests