Indirection Operator (FPScript)

23.08.2021

Used to access data sets, functions and variables by using their names.

Syntax

$Expression$

 

The syntax of the indirection operator consists of the following elements:

Element

Description

Expression

Any expression which returns a string.

Remarks

The operator allows indirect access to any objects, e.g. a data set or a document, by using its path name.

You can use the above syntax at all positions in the code where an object name is permitted.

Formulas that use the indirection operator are recalculated every time they are updated. If you access a different formula using the indirection operator, this formula will be updated before each access to the data.

If no component is specified, the operator supplies an object reference, i.e. $"DataSet"$ is equivalent to DataSet As Object. If a component is specified, it supplies the component's value, i.e. $"DataSet.X"$ is equivalent to DataSet.X.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

$"DataSet"$

Returns the content of a data set called "DataSet".

$"\\ActivatedFolder\\DataSet"$

Returns the content of a data set with the name "DataSet", which is located in the activated subfolder of the root folder.

$"Signal.Y"$ or $"Signal"$.Y

Returns the content of the Y component of a data set called "Signal".

$"Function"$(Signal)

Calls the FPScript function "Function" and passes Signal as the argument.

DataSet.$"Comments"$

Reads the object property called "Comments" from the data set.

$"\\Folder1\\MyDoc.doc"$.Name

Returns the name of a document "MyDoc" located in the folder "Folder1".

Dim names, max, globalmax

Calculates the global maximum of all data sets located in the root folder and whose names begin with "Data".

names = .Parent.Objects("Data.*").Names

 

For Each Row i In names Do

   max = Maximum($names$)

   If DataType(globalmax) == TYPE_EMPTY Or max > globalmax then

       globalmax = max

   End

End

 

See Also

Path Names

Object Reference

ActivatedFolder Statement

* This operator is not available in FlexPro View.

Share article or send as email:

You might be interested in these articles