Ingreso rápido:  

Forum: Old versions

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

Este tópico es antiguo y puede contener información incorrecta para la nueva versión.

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?
 

Mensajes 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! ;) )
 

Mensajes Tue 03 Feb 15 @ 6:22 am


(Los tópicos y foros antiguos son automáticamente cerrados)