aargh Posted February 4, 2014 Share Posted February 4, 2014 Hi I have a problem with the latest version of Unigine. (310114 GAME)This code worked fine in the previous version, and now reports an error. simplified code is: void main() { int var1 = 6; int var2 = var1>10?var1:3*(var1-5); //here is an error log.message("var1 %d var2 %d",var1,var2); } and reported error is: Interpreter::parse_expression(): some errors with count of '(' and ')' symbols in "3*(var1-5" expression Link to comment
silent Posted February 5, 2014 Share Posted February 5, 2014 Hi, Ternary operator behavior was fixed in the latest SDK. Now you can write expressions in braces. Please, use following code to fix this issue: int var2 = (var1 > 10) ? var1 : (3*(var1 - 5)) Also, please check updated documentation on ternary operator: https://developer.unigine.com/en/docs/1.0/scripting/language/operators#assignment How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
aargh Posted February 5, 2014 Author Share Posted February 5, 2014 Ok Thank you for the quick reply ;-) Link to comment
Recommended Posts