Difference between revisions of "IndexValue"

Line 4: Line 4:
 
[[What's new in Analytica 4.0?]] >
 
[[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 I. Some variables have both an index
+
== Details ==
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 (I) alone would return its result value.
+
The [[IndexValue]] function, if it weren't built-in, could easily be defined as:
 +
:<code>Function IndexValue(I: IndexType) := I</code>
  
= Library =
+
== Examples ==
 
+
:<code>Index L := [I, J, K, "value"]</code>
[[Array Functions]]
+
:<code>Index rows := 1..Size(A)</code>
 
+
:<code>Variable Flat_A := MdArrayToTable(A, rows, IndexValue(L))</code>
= 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) )
 
  
 
Download example model file  
 
Download example model file  
 
[[Image:IndexValueFunctionEg.ANA|Index Value Function Example]].
 
[[Image:IndexValueFunctionEg.ANA|Index Value Function Example]].
  
= See Also =  
+
==History==
 +
[[IndexValue]] is new to Analytica 4.0 and requires build 4.0.0.33 or later.
  
 +
== See Also ==
 
* [[Mid]]
 
* [[Mid]]
 
* [[Sample]]
 
* [[Sample]]
 
* [[Function Parameter Qualifiers#IndexType|IndexType]] parameter qualifier
 
* [[Function Parameter Qualifiers#IndexType|IndexType]] parameter qualifier

Revision as of 19:15, 15 January 2016

What's new in Analytica 4.0? >

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 example model file File:IndexValueFunctionEg.ANA.

History

IndexValue is new to Analytica 4.0 and requires build 4.0.0.33 or later.

See Also

Comments


You are not allowed to post comments.