Difference between revisions of "Error Messages/40616"
AManandhar (talk | contribs) m (→Remedies) |
AManandhar (talk | contribs) m (→Cause) |
||
Line 7: | Line 7: | ||
You are trying to assign a value to a slice of a global variable which is not allowed. Objects in Analytica are not allowed to have side effects, and can only change the values of local variables defined with a Var. | You are trying to assign a value to a slice of a global variable which is not allowed. Objects in Analytica are not allowed to have side effects, and can only change the values of local variables defined with a Var. | ||
+ | The following scenario would trigger this error. Here Object2 is assigning to a slice of the global variable object, Object1. | ||
+ | |||
+ | Definition of Index1: | ||
+ | <code>1..9</code> | ||
+ | |||
+ | Definition of Object1: | ||
+ | <code>Table(Index1)(7, 8, 3, 2, 5, 4, 9, 1, 5)</code> | ||
+ | |||
+ | Definition of Object2; | ||
+ | <code>Object[Index1 = 5] := 5 </code> | ||
= Remedies = | = Remedies = |
Revision as of 19:51, 22 January 2010
Error Message Examples
You cannot assign to a slice or subscript of a global variable object.
Cause
You are trying to assign a value to a slice of a global variable which is not allowed. Objects in Analytica are not allowed to have side effects, and can only change the values of local variables defined with a Var.
The following scenario would trigger this error. Here Object2 is assigning to a slice of the global variable object, Object1.
Definition of Index1:
1..9
Definition of Object1:
Table(Index1)(7, 8, 3, 2, 5, 4, 9, 1, 5)
Definition of Object2;
Object[Index1 = 5] := 5
Remedies
One way to get around this issue is to use a Button which can have side effects and can assign to global variable slices. Scripts and Buttons are only available in Analytica Enterprise and higher.
Comments
<comments />
Enable comment auto-refresher