Difference between revisions of "Error Messages/40020"

Line 21: Line 21:
 
== Suggested revised message ==
 
== Suggested revised message ==
  
In a construct "WHILE <b> DO <e>", the condition <b> should be a scalar (true(non-zero) or false(zero)), but not an array.  See the User Guide Chapter "Procedural Programming" section on "Ensuring Array Abstraction" on how to deal with this.
+
In a construct "WHILE <b> DO <e>, the condition should be a scalar (true(non-zero) or false(zero)), but not an array.  See the [[Analytica User Guide]] chapter [[Procedural Programming]] section [[Ensuring Array Abstraction]] on how to deal with this.
  
 
<br>
 
<br>
 
<comments />
 
<comments />

Revision as of 21:54, 2 February 2016

Error Message Examples

The condition for "while" evaluates to an array. It should evaluate to true(non-zero) of false(zero).

Cause

This error is caused when an array is passed as the condition of a while loop. The following code will produce this error as Time is an array and "Time > 5" will evaluate to an array.

Var a:= 5;
While( Time > 5 ) Do{
a++;
}
...

Remedies

Correct the condition for the while loop so it evaluates to true or false.

Suggested revised message

In a construct "WHILE DO <e>, the condition should be a scalar (true(non-zero) or false(zero)), but not an array. See the Analytica User Guide chapter Procedural Programming section Ensuring Array Abstraction on how to deal with this.



You are not allowed to post comments.

Comments
<comments />