Difference between revisions of "IndexValue"

(category)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[category:Array Functions]]
 
[[category:Array Functions]]
 +
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[category:Evaluation Functions]]
 
[[category:Evaluation Functions]]
[[What's new in Analytica 4.0?]] >
 
  
(new to Analyica 4.0, requires build 4.0.0.33 or later)
+
== IndexValue(I) ==
 +
Returns the index value for the given variable or index «I». Some variables have both an index value and a result value. Examples include -- a [[Self-Indexed Arrays|self-indexed array]]; a variable or index defined as a list of identifiers or list of expressions; and a [[Choice]] list with a self-domain. [[IndexValue]](I) returns the index value of «I», where <code>(I)</code> alone would return its result value.
  
= IndexValue(I) =
+
== Library ==
 +
Array Functions
  
Returns the index value for the given variable or index.
+
== Details ==
 +
The [[IndexValue]] function, if it weren't built-in, could easily be defined as:
 +
:<code>Function IndexValue(I: IndexType) := I</code>
  
In Analytica, a variable may have both an index value and a result value. This may occur in a [[Self-Indexed Arrays|self-indexed array]], in a variable or index defined as a list of identifiers or list of expressions, or in a Choice list with a self-domain, to list a few examples.
+
== Examples ==
 +
:<code>Index L := [I, J, K, "value"]</code>
 +
:<code>Index rows := 1..Size(A)</code>
 +
:<code>Variable Flat_A := MdArrayToTable(A, rows, IndexValue(L))</code>
  
The IndexValue function gives you access to the index value from a value context.
+
Download an example model file [[File:IndexValueFunctionEg.ANA]].
  
= Library =
+
==History==
 
+
[[IndexValue]] was introduced in Analytica 4.0 and requires build 4.0.0.33 or later.
[[Array Functions]]
 
 
 
= Details =
 
 
 
The IndexValue function, if it weren't built-in, could easily be defined within Analytica 4.0 as:
 
Function IndexValue( I : [[Function Parameter Qualifiers#IndexType|IndexType]] ) := I
 
 
 
This definition, however, requires Analytica 4.0 or later.
 
 
 
= Examples =
 
 
 
  Index L := [I,J,K,"value"]
 
  Index rows := 1..[[Size]](A)
 
  Variable Flat_A := [[MdArrayToTable]]( A, rows, IndexValue(L) )
 
 
 
= See Also =
 
  
 +
== See Also ==
 
* [[Mid]]
 
* [[Mid]]
 
* [[Sample]]
 
* [[Sample]]
 
* [[Function Parameter Qualifiers#IndexType|IndexType]] parameter qualifier
 
* [[Function Parameter Qualifiers#IndexType|IndexType]] parameter qualifier
 +
* [[Domain Indexes]]
 +
* [[CopyIndex]]
 +
* [[AddIndex]]
 +
* [[Self-Indexed Arrays]]

Latest revision as of 19:15, 19 April 2016


IndexValue(I)

Returns the index value for the given variable or index «I». Some variables have both an index value and a result value. Examples include -- a self-indexed array; a variable or index defined as a list of identifiers or list of expressions; and a Choice list with a self-domain. IndexValue(I) returns the index value of «I», where (I) alone would return its result value.

Library

Array Functions

Details

The IndexValue function, if it weren't built-in, could easily be defined as:

Function IndexValue(I: IndexType) := I

Examples

Index L := [I, J, K, "value"]
Index rows := 1..Size(A)
Variable Flat_A := MdArrayToTable(A, rows, IndexValue(L))

Download an example model file File:IndexValueFunctionEg.ANA.

History

IndexValue was introduced in Analytica 4.0 and requires build 4.0.0.33 or later.

See Also

Comments


You are not allowed to post comments.