/set in editbox, /var .secs - 12/11/18 06:49 PM
I came across these issues while replying to the /saveini thread.
(1) When a local %var is created, it clones the .secs value from an existing global var of the same name. Luckily it appears the .secs value is ignored, even when the local scope contains a while() that lasts longer, as the local's .secs isn't getting decremented.
(2) In editbox, when /set is used with a single slash, and there is more than 1 space preceding the switch parameter and/or the %var_name, it generates an error and does not set the variable.
I'm not aware of another /command that behaves as if it even notices whether you've used consecutive spaces or not. Though this way does allow setting global variables containing consecutive spaces, it shouldn't need to forbid them preceding the variable name.
EDIT: **
sorry for the typo. I meant for my examples to show using the /SET command not /VAR, which instead is treated as if an invalid command that gets sent to the server, even with the -g switch.
(1) When a local %var is created, it clones the .secs value from an existing global var of the same name. Luckily it appears the .secs value is ignored, even when the local scope contains a while() that lasts longer, as the local's .secs isn't getting decremented.
Code:
//set -u2 %x global | var %x local $time , %i 99999 | while (%i) { var %a $sha1(abc) | dec %i } | echo -a $time : secs $var(%x,1).secs local? $var(%x,1).local value $var(%x,1).value vs secs $var(%x,2).secs local? $var(%x,2).local value $var(%x,2).value
(2) In editbox, when /set is used with a single slash, and there is more than 1 space preceding the switch parameter and/or the %var_name, it generates an error and does not set the variable.
Quote:
* /set: invalid parameters
Code:
/var -s %x test1 /var -s %x test2 /var -s %x test3
I'm not aware of another /command that behaves as if it even notices whether you've used consecutive spaces or not. Though this way does allow setting global variables containing consecutive spaces, it shouldn't need to forbid them preceding the variable name.
EDIT: **
sorry for the typo. I meant for my examples to show using the /SET command not /VAR, which instead is treated as if an invalid command that gets sent to the server, even with the -g switch.