快速登录:  

Forum: Old versions

话题: VDJscript boolean variables constants true/false yes/no on/off

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

For simple boolean variables I can use values 0/1 in my script. But at some example I also see constant values for it like:

true/false yes/no on/off

When I try to use them in a custom button:

set 'myvariable' true
set 'myvariable' false
set 'myvariable' on
set 'myvariable' off
set 'myvariable' yes
set 'myvariable' no

The only "set" that worked is the "on" and this set the value to 1, "yes" and "true" set the value to 0? Strange. All "true", "on" and "yes" give a signal back to the button, if value is 1 or 0. A click on "false", "off" and "no" does not change the value to 0.

Can somebody explain me if and how I can use these constants?
 

发表时间 Tue 03 Feb 15 @ 5:57 am
Variables are only numeric.
Therefore you should always use 0/1

Finally, for most scripts, when you parse a variable 0 stands for "false" or "off" and 1 stands for "true" or "yes"
However, the opposite DOES NOT apply! (As I already explained, variables are numeric! ;) )
 

发表时间 Tue 03 Feb 15 @ 6:22 am


(陈旧帖子或论坛版块会自动关闭)