VAR_MATCH Function

Standard Library function that scans for PV‑WAVE variables that match the given criteria.

Usage

vars = VAR_MATCH( )

Input Parameters

None.

Returned Value

vars—An array of variable names that match the criteria given by the keywords. If no matches are found a scalar NULL string is returned.

Keywords

Count—If set, returns the number of variables that matched the criteria.

Dimensions—A string or string array specifying the exact dimensions of the variable(s) that you wish to have returned. If an array, returns variables matching any of the dimensions. The string must have the following pattern:

'NxNx...xN' or
['NxNx...xN', ..., 'NxNx...xN']

For example:

Dimensions = '256x256x3', or
Dimensions = ['256x256x3', '3x512', '3x640'] 

If you set Dimensions equal to N, it will return all 1D arrays with N elements. Similarly, Dimensions = '0' will return all scalar variables (much like specifying NDimensions = 0)

Level—Specifies the program level for which variables are to be considered.

If Level ³ 0, levels are counted up from $MAIN$ to the current level.

If Level £ 0, levels are counted down from the current level.

If this keyword is not specified, $MAIN$ is assumed.

Names—Specifies patterns to be matched. The patterns are used to find and display variable names. If this keyword is not specified, all variables are considered. As with INFO, the asterisk (*) and question mark (?) may be used to match any string or a single character, respectively.

NDimensions—A scalar or array specifying the number of dimensions to be matched.

Type—A scalar or array specifying the type(s) of variables to be matched, according to the following table (PV‑WAVE designation listed in parentheses):

0—Undefined

1—Byte (BYTE)

2—Integer (INT)

3—Longword integer (LONG)

4—Floating point (FLOAT)

5—Double precision floating (DOUBLE)

6—Complex single-precision floating (COMPLEX)

7—String (STRING)

8—Structure

9—(not used)

10—List (LIST)

11—Associative array (ASARR)

12—Complex double-precision floating (DCOMPLEX)

13—32-bit integer (INT32)

Discussion

The filtering precedence of the VAR_MATCH function is Level, Names, Type, NDimensions, and Dimensions.

Example

The following line of code finds the names of any BYTE, INT, LONG, or INT32 arrays with dimensions (3, 256).

var_list = VAR_MATCH(Dimensions='3x256', Type=[1, 2, 3, 13])

See Also

INFO, SIZE, UPVAR