Error Messages/40123

Example Error Messages

For x do u
      ^
expecting :=
Var x;
     ^
expecting :=
^
expecting :=

Cause

You have a syntax error in the declaration of a local variable. When you declare a local variable, you must assign it an initial value.

The third case, and related cases where the position is at the beginning of the line shown, but the line shown has nothing to do with a variable declaration, may appear when you have a declaration with a new-line following the variable name, e.g., only:

 Var x
  

Or in this this case:

 Var x
 Sum(x+y,I)

you'd see:

 Sum(x+y,I)
 ^
 expected :=

That's because Analytica allows you to place whitespace anywhere in an expression, and the fact that the := is missing doesn't become evident until the line following the Var x declaration. So in these cases, be sure to look at the line preceding, which will be a local variable declaration (Var..Do, For..Do, MetaVar..Do, LocalAlias..Do, etc.)

Remedy

In the For loop case, provide the set of values to iterate over, e.g.:

For x:=I do u

In the declaration case, provide some initial value, even if it is just Null or 0, e.g.:

Var x:=Null;
...
Comments


You are not allowed to post comments.