Difference between revisions of "Error Messages/40539"

(Var..Do to Local..Do)
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
  
 
<pre style="background:white; border:white; margin-left: 1em; font-style:italic">
 
<pre style="background:white; border:white; margin-left: 1em; font-style:italic">
  Local variables (e.g., parameters or locals declared using FOR, VAR, or USING) are not
+
  Local values (e.g., parameters or locals declared using For or Local, or the deprecated Var, MetaVar or Using) are not
 
  objects and thus have no attributes.  An attempt has been made to assign to the attribute
 
  objects and thus have no attributes.  An attempt has been made to assign to the attribute
  of a non-object, which is not possible
+
  of a non-object, which is not possible.
 
</pre>
 
</pre>
  
Line 12: Line 12:
 
You tried to set an attribute of a local variable or a parameter which is not allowed. The following code would generate this error:
 
You tried to set an attribute of a local variable or a parameter which is not allowed. The following code would generate this error:
  
:<code>Var Local_a := 5; </code>
+
:<code>[[Local]] Local_a := 5; </code>
:<code>Description of Local_a := "Description of local variable, Local_a"; </code>
+
:<code>[[Description]] [[of]] Local_a := "Description of local variable, Local_a"; </code>
 
:<code>...</code>
 
:<code>...</code>
  
Line 24: Line 24:
 
* [[Attributes]]
 
* [[Attributes]]
 
* [[Objects and Values]]
 
* [[Objects and Values]]
* [[Local Variables]]
+
* [[Local Values]]
 
* [[Function calls and parameters]]
 
* [[Function calls and parameters]]
* [[Var..Do]]
+
* [[Local..Do]]
 
* [[For..Do]]
 
* [[For..Do]]
* [[Using..Do]]
 

Latest revision as of 00:20, 9 October 2021


Error message examples

 Local values (e.g., parameters or locals declared using For or Local, or the deprecated Var, MetaVar or Using) are not
 objects and thus have no attributes.  An attempt has been made to assign to the attribute
 of a non-object, which is not possible.

Cause

You tried to set an attribute of a local variable or a parameter which is not allowed. The following code would generate this error:

Local Local_a := 5;
Description of Local_a := "Description of local variable, Local_a";
...

Attributes can only be assigned to Analytica objects, i.e. variables defined by adding a node to the model.

Remedies

One solution would be to create a node variable instead of the local variable, and then assign the attribute for the created object.

See Also

Comments


You are not allowed to post comments.