Jump to content

Am I stupid?


Amphei Jierdon
 Share

You are about to reply to a thread that has been inactive for 2786 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to write a simple script...

but the line 

    integer x = 1 + 1;

throws a syntax error. 

    float x = 100 / 255

also 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

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    }}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2786 days.

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
 Share

×
×
  • Create New...