CloseRange
Member
This is a weird question but i was wondering if it's possible to set a variable while inside a condition.
For example I have a script that returns either an instance of an object or false. Could I do something like this:
I do know game maker is weird with == vs = and so I'm just worried it will try to check if o is equal to the return of script. (not how most languages work but okkkkk)
Also, kinda related, I tried this but couldn't seem to get it to work. Maybe I have the formatting wrong but most languages you can do this:
so b gets set to 10 and a gets set to b (so both a and b are 10). I thought I remember this being a valid thing.
For example I have a script that returns either an instance of an object or false. Could I do something like this:
Code:
var o;
while(o = script()) {
show_debug_message(o.name);
}
Also, kinda related, I tried this but couldn't seem to get it to work. Maybe I have the formatting wrong but most languages you can do this:
Code:
var a, b;
a = b = 10;