Amphei Jierdon Posted September 23, 2016 Share Posted September 23, 2016 I am trying to write a simple script...but the line integer x = 1 + 1;throws a syntax error. float x = 100 / 255also throws a syntax error.It doesn't accept the + operator or any algebraic operator like -, *, or / I do not understand what is wrong. Can anyone give me a code snippet with some simple algebraic operations that work, so I can find out what I do wrong? Thanks :) Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 23, 2016 Share Posted September 23, 2016 Where are you doing those? Not in the global definitions, I assume. You can't calculate things outside the main body of the script. integer x = 1 + 1; // Does not workdefault{ // whatever} But integer x;default{ state_entry() { x = 1 + 1; // Does work }} 1 Link to comment Share on other sites More sharing options...
Amphei Jierdon Posted September 23, 2016 Author Share Posted September 23, 2016 Thank you Senior, now it works, and I understood, why it didn't work before :) Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now