Jump to content

Am I stupid?


Amphei Jierdon
 Share

You are about to reply to a thread that has been inactive for 2192 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 2192 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...