Difference between revisions of "Error Messages/40099"

(Created page with "= Example Warning Message = Warning: -1 is not an element of the Time index. = Cause = Your model is evaluating a dynamic loop. During this evaluation, an e...")
 
 
Line 1: Line 1:
= Example Warning Message =
+
[[Category: Error messages]]
 +
== Example warning message ==
  
Warning:
+
:<code>''Warning: -1 is not an element of the Time index.''</code>
-1 is not an element of the [[Time]] index.
 
  
= Cause =
+
== Cause ==
  
 
Your model is evaluating a [[Dynamic|dynamic]] loop.  During this evaluation, an expression attempted to access an element
 
Your model is evaluating a [[Dynamic|dynamic]] loop.  During this evaluation, an expression attempted to access an element
 
(e.g., using [[Subscript]]) that does not correspond to an element of the [[Time]] index.  This might occur, for example, if you tried to use a value from a time period before your first time period.
 
(e.g., using [[Subscript]]) that does not correspond to an element of the [[Time]] index.  This might occur, for example, if you tried to use a value from a time period before your first time period.
  
= Remedy =
+
== Remedy ==
  
 
This might be exposing a logical error.  But if this is intention, this is only a warning, so you can ignore it, e.g.:
 
This might be exposing a logical error.  But if this is intention, this is only a warning, so you can ignore it, e.g.:
  
 
Change:
 
Change:
:X[Time=v]
+
:<code>X[Time = v]</code>
 
to
 
to
:[[IgnoreWarnings]](X[Time=v])
+
:<code>IgnoreWarnings(X[Time = v])</code>
  
 
or you can make the logic explicit:
 
or you can make the logic explicit:
:[[If]] v>=0 [[Then]] X[Time=v] [[Else]] [[Null]]
+
:<code>If v >= 0 Then X[Time = v] Else Null</code>
  
Or (''new to [[Analytica 4.3]]''), you can specify a default value:
+
Or you can specify a default value:
:X[Time=v,defval:0]
+
:<code>X[Time = v, defval: 0]</code>
The defval is used when v is not found in the Time index.
 
  
= See Also =
+
The defval is used when <code>v</code> is not found in the [[Time]] index.
 +
 
 +
== See Also ==
 
* [[Subscript]]/[[Slice]]
 
* [[Subscript]]/[[Slice]]
 
* [[Dynamic]]
 
* [[Dynamic]]
 
* [[IgnoreWarnings]]
 
* [[IgnoreWarnings]]
 +
* [[If-Then-Else]]
 +
* [[Arrays and Indexes]]

Latest revision as of 23:48, 17 March 2016

Example warning message

Warning: -1 is not an element of the Time index.

Cause

Your model is evaluating a dynamic loop. During this evaluation, an expression attempted to access an element (e.g., using Subscript) that does not correspond to an element of the Time index. This might occur, for example, if you tried to use a value from a time period before your first time period.

Remedy

This might be exposing a logical error. But if this is intention, this is only a warning, so you can ignore it, e.g.:

Change:

X[Time = v]

to

IgnoreWarnings(X[Time = v])

or you can make the logic explicit:

If v >= 0 Then X[Time = v] Else Null

Or you can specify a default value:

X[Time = v, defval: 0]

The defval is used when v is not found in the Time index.

See Also

Comments


You are not allowed to post comments.