Hi everyone,
I'm trying to find out if Hollywood supports the use of ternary operators for conditional assignments. Specifically, I'm looking to use a syntax like this:
---
Local variable = condition ? value1 : value2
---
If Hollywood doesn’t support this syntax, are there any recommended alternatives for conditional assignments in a single line?
Thank you for your help!
bySpawnPPC
Can I use ternary operators in Hollywood?
Re: Can I use ternary operators in Hollywood?
Hollywood has the IIf() function which does that:
Code: Select all
Local variable = IIf(condition, value1, value2)Otherwise you might have to search for alternatives done in Lua... like http://lua-users.org/wiki/TernaryOperator
Re: Can I use ternary operators in Hollywood?
Thanx for the help !!!
bySpawnPPC
bySpawnPPC