Error Messages/40616

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 (subscripted element) of a global variable. This is not permitted, since it would contravene Analytica's general principle of no side-effects. You may assign to a slice of a local variable.

This example triggers 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] := 6

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.

You can also assign to a global variable, V, from the definition of X when V is defined as ComputedBy(X). Here is a link to the documentation of function ComputedBy.



You are not allowed to post comments.

Comments
<comments />