setting variables inside conditions


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:
var o;
while(o = script()) {
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:
var a, b;
a = b = 10;
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.


while script()

But no, that won't work.

In your second code, a would be equal to 0 or 1. The only inline modifications you can do are ++ and --.
Just a note, Game Maker Language will receive a major update in the following months. If I'm correct, we'll be able to do what the OP asks for then.