Conditional and assignment expressions

Status
Not open for further replies.

Plombo

OpenBOR Developer
Staff member
As of yesterday, the script engine supports C-style conditional expressions, like
Code:
int a = foo ? bar : baz;

While implementing conditional expressions, I noticed that assignments, when used as expressions, weren't giving the right value, and compound assignments (like +=) weren't pushing any expression value onto the stack at all, and confusing the compiler in the process.  So they are fixed now too. :)
 
Ahh, another nice touch Plombo! There are plenty of coders out there that would disparage conditionals and switches (for some admittedly good reasons), but since we don't have a debugger none of that applies to OpenBOR script. Cleaner, more human readable code wins the day!

DC
 
Status
Not open for further replies.
Back
Top Bottom