Expressions!!?!
Moderator: Martin
Expressions!!?!
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?
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: Expressions!!?!
Haha lol yup i think i do too... thanks darlin
Re: Expressions!!?!
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
if value contains boolean true/false. Or even stranger thing like
because sleep() will always be evaluated to true!
Code: Select all
value
Code: Select all
sleep(1000)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Expressions!!?!
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
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!!?!
That should work:
Or simply:
Code: Select all
if (value == my_value){
return true;
}
Code: Select all
value == my_value