Difference between revisions of "Error Messages/40539"
AManandhar (talk | contribs) (→Cause) |
|||
Line 1: | Line 1: | ||
− | + | [[Category: Error messages]] | |
+ | == Error message examples == | ||
+ | |||
+ | <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 variables (e.g., parameters or locals declared using FOR, VAR, 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> | ||
− | = Cause = | + | == 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: | 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> | + | :<code>Var Local_a := 5; </code> |
− | Var Local_a: = 5; < | + | :<code>Description of Local_a := "Description of local variable, Local_a"; </code> |
− | Description of Local_a : = "Description of local variable, Local_a"; < | + | :<code>...</code> |
− | ... | ||
− | </code> | ||
Attributes can only be assigned to Analytica objects, i.e. variables defined by adding a node to the model. | Attributes can only be assigned to Analytica objects, i.e. variables defined by adding a node to the model. | ||
− | = Remedies = | + | == Remedies == |
− | |||
One solution would be to create a node variable instead of the local variable, and then assign the attribute for the created object. | 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== | |
+ | * [[Attributes]] | ||
+ | * [[Objects and Values]] | ||
+ | * [[Local Variables]] | ||
+ | * [[Function calls and parameters]] | ||
+ | * [[Var..Do]] | ||
+ | * [[For..Do]] | ||
+ | * [[Using..Do]] |
Revision as of 21:12, 15 March 2016
Error message examples
Local variables (e.g., parameters or locals declared using FOR, VAR, 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:
Var 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
Enable comment auto-refresher