Page 1 of 1

Expressions!!?!

Posted: 16 Dec 2019 00:27
by Lucy
Im not too sure of what exactly i can do with expressions... i only know basic stuff. Can i use expression in such a way as this to produce boolean to true/false or do i need to do it differently?
Screenshot_20191216-112536.jpg
Screenshot_20191216-112536.jpg (234.22 KiB) Viewed 11609 times

Re: Expressions!!?!

Posted: 16 Dec 2019 10:38
by Micky Micky
Yes, but I think you have that the wrong way round.

Re: Expressions!!?!

Posted: 16 Dec 2019 11:10
by Lucy
Haha lol yup i think i do too... thanks darlin

Re: Expressions!!?!

Posted: 16 Dec 2019 17:49
by Desmanto
You can put anything above the expression. I sometimes have tons of script in the expression and the last line will ends with a simple boolean check. As long as the last line return boolean check. Or the expression can end anywhere that has return true/false, that it is fine. You can even put something like

Code: Select all

value
if value contains boolean true/false. Or even stranger thing like

Code: Select all

sleep(1000)
because sleep() will always be evaluated to true!

Re: Expressions!!?!

Posted: 17 Dec 2019 04:25
by Lucy
Haha really... sleep > true... lol thats so obvious and easy... i shoulda thought of 5hat🤪😂
I tried a simple "if (value = my_value); return true;" but it errored and said cannot convert null to boolean!? I think that was roughly what i originally had in expression

Re: Expressions!!?!

Posted: 17 Dec 2019 21:54
by Horschte
That should work:

Code: Select all

if (value == my_value){
  return true;
}
Or simply:

Code: Select all

value == my_value