Connexion rapide:  

Forum: Old versions

Sujet VDJscript boolean variables constants true/false yes/no on/off

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

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?
 

Posté 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! ;) )
 

Posté Tue 03 Feb 15 @ 6:22 am


(Les anciens sujets et forums sont automatiquement fermés)