Difference between revisions of "Error Messages/40018"
(Removed incorrect statement saying that buttons are only available in Enterprise edition) |
|||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
== Error message examples == | == Error message examples == | ||
− | :<code>''You can only assign to a local | + | :<code>''You can only assign to a local value. X is not a local value.''</code> |
== Cause == | == Cause == | ||
− | This error is caused when a global variable is assigned inside another variable [[definition]]. You can only assign values to [[Local | + | This error is caused when a global variable is assigned inside another variable [[definition]]. You can only assign values to [[Local Values|local values]], which declared by using <code>[[MetaVar]]</code> or <code>Var</code> inside the definition. |
Changing the value of the global variable inside another variable is, generally, not a good practice. | Changing the value of the global variable inside another variable is, generally, not a good practice. | ||
Line 13: | Line 13: | ||
== Remedies == | == Remedies == | ||
− | One way to get around this issue is to use a [[Button]] which can have side effects and can assign to global variable | + | One way to get around this issue is to use a [[Button]] which can have side effects and can assign to global variable. |
You can also assign to a global variable, <code>V</code>, from the definition of <code>X</code> when <code>V</code> is defined as [[ComputedBy]](X). | You can also assign to a global variable, <code>V</code>, from the definition of <code>X</code> when <code>V</code> is defined as [[ComputedBy]](X). | ||
Line 20: | Line 20: | ||
* [[Assignment Operator :=]] | * [[Assignment Operator :=]] | ||
* [[Analytica_Script#Assigning_to_globals|Assigning to global variables]] | * [[Analytica_Script#Assigning_to_globals|Assigning to global variables]] | ||
− | * [[Local | + | * [[Local Values|Local values]] |
* [[Definition]] | * [[Definition]] | ||
* [[Buttons]] | * [[Buttons]] | ||
* [[ComputedBy]] | * [[ComputedBy]] |
Latest revision as of 16:01, 13 July 2018
Error message examples
You can only assign to a local value. X is not a local value.
Cause
This error is caused when a global variable is assigned inside another variable definition. You can only assign values to local values, which declared by using MetaVar
or Var
inside the definition.
Changing the value of the global variable inside another variable is, generally, not a good practice.
Remedies
One way to get around this issue is to use a Button which can have side effects and can assign to global variable.
You can also assign to a global variable, V
, from the definition of X
when V
is defined as ComputedBy(X).
See Also
Comments
Enable comment auto-refresher