Documentation:Reference:TDI VWXYZ - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

VALIDATION (PARAM)

MDS Operation. Evaluate the validation field of a parameter.

Argument. PARAM must be or make a param.

Result.. Sets $THIS to the parameter and sets $VALUE to the
value field of the param and
does DATA(validation field).

Example. Let _A=BUILD_PARAM(42,"text of this param",$VALUE<6),
then VALIDATION(_A) is $FALSE.

VALIDATION_OF (A)

MDS Operation. Get the validation field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_PARAM, the validation field.
Otherwise, an error.
>>>>>>>>>WARNING, because the validation field is likely to use
$VALUE or $THIS, DATA(VALIDATION_OF(parmeter)) will not
work. Use VALIDATION(parameter) for the correct result.

Example. VALIDATION_OF(BUILD_PARAM(42,"the answer",$VALUE>6)) is
$VALUE>6, which cannot be evaluated.

VALUE_OF (A)

MDS Operation. Get the value field.

Argument. Descriptor as below.

Result.. A is searched for these:
DSC$K_DTYPE_DIMENSION, VALUE_OF(window field).
DSC$K_DTYPE_PARAM, the value field.
DSC$K_DTYPE_SIGNAL, the data field.
DSC$K_DTYPE_WINDOW, the value_at_idx0 field.
DSC$K_DTYPE_WITH_UNITS, the data field.
Otherwise, DATA(A).
>>>>>>>>>WARNING, because the data field of a signal is likely to
use $VALUE, DATA(VALUE_OF(signal)) may not work.
Use DATA(signal) instead.

Example. VALUE_OF(BUILD_PARAM(42,"the answer",$VALUE>6)) is 42.

VAR (STRING,[REPLACE])

Variables. Specifies a private or public variable by textual name.

Argument. Optional: REPLACE.
STRING the character scalar name of a variable.
>>>>>>>>>WARNING, all name that do not begin with an underscore (_) or
dollar sign ($) cannot be accessed other than by VAR.
$-names are reserved for system names.
REPLACE the new value of STRING.

Result.. That of the old contents of the variable.

Example. _A=42,VAR("_A") is 42.

VECTOR (X,...)

F90 Modified Transformation. Form a vector or array from scalar,
vector, array, range, and promote inputs.
Usual Form [X,...].
For F90 compatiblity, (/ is [ and /) is ].

Arguments Must be compatible types.

Signals. Single signal or smallest data.
Units... Single or common units, else bad.
Form.... Type of highest data type found. The size is the sum of
the sizes of all the arguments.
If the shapes of all arguments are the same, the result
has one more dimension, the last, of size equal to the
number of arguments. F90 defines only a vector result.

Result.. A vector with all the values in the arguments.
Immediate at compilation.

Examples. [2,3:5,4@6] is [2,3,4,5,6,6,6,6].
[[1,2],[3,4],5:6] is [1 3 5], long array shaped [2,3].
[2 4 6]
1:3 is a vector, [1:3] is an array of shape [1,3],
so don't use extraneous brackets.

VERIFY (STRING,SET,[BACK])

F90 Character Elemental. Verify that a set of characters has all the
character in a string.

Arguments Optional: BACK.
STRING character.
SET character.
BACK logical.
Signals. Single signal or smaller data.
Units... Same as STRING.
Form.... Integer type, compatible shape of all.

Result.. The result is -1 if STRING contains only the characters
that are in SET of if the length of STRING or SET is 0.
(i) BACK is absent or false. The offset of the leftmost
character of STRING that is not in SET.
(ii) BACK present and true. The offset of the rightmost
character of STRING that is not in SET.

Examples. VERIFY('ABBA','AB') is -1.
(i) VERIFY('ABBA','A') is 1.
(ii) VERIFY('ABBA','A',$TRUE) is 2.

See also. SCAN to find a character in a set.

WAIT (SECONDS)

IO. Suspend processing for at least the time given.

Argument. SECONDS must be real scalar.

Result.. None.

Example. WAIT(3.5) delays 3 and 1/2 seconds. this might retain
a plot or comment for a short time.

WHEN_OF (A)

MDS Operation. Get the when field.

Argument. Descriptor as below.

Result.. DISPATCH_OF(A) is searched for this:
DSC$K_DTYPE_DISPATCH, the when field.
Otherwise, an error.

where (TEST,STMT,[ELSESTMT])

F90 Statement. Do statement if expression true, else possibly do
another. Unsubscripted variables that would be replaced
and that are of matching size have only the true
elements replaced/calculated.
Required Usual Forms. WHERE (TEST) STMT,
WHERE (TEST) STMT ELSEWHERE ELSESTMT.
Function Form where(TEST,STMT,[ELSESTMT]).
May be syntatically invalid.

Arguments Optional: ELSESTMT.
TEST logical array, this is an "array IF".
STMT statement.
ELSESTMT statement.

Result.. None.

Example. WHERE (_A > 0) _A += 6; ELSEWHERE _A -= 6;.

WHILE (TEST,STMT,...)

CC Statement. Repeat while expression is true.
Require Usual Form. WHILE (TEST) STMT.
Function Form WHILE(TEST,STMT,...). May be syntatically invalid.

Arguments
TEST logical scalar.
STMT statement, simple or {compound}.
>>>>>>WARNING, multiple statements in call form are considered
to be in braces.
Result.. None.

Example. WHILE (RANDOM()<0.99) ++_J;

WINDOW_OF (A)

MDS Operation. Get the window field.

Argument. Descriptor as below.

Result.. A is searched for these:
DSC$K_DTYPE_DIMENSION, the window field.
DSC$K_DTYPE_WINDOW, unchanged.
Otherwise, an error.

WORD (A)

Conversion Elemental. Convert to word (two-byte) integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Word-length integer.
Result.. The truncated whole part of A.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.

Examples. WORD(123) is 123W. WORD(65537) is 1W.

WORD_UNSIGNED (A)

Conversion Elemental. Convert to word (two-byte) unsigned integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Word-length unsigned integer.

Result.. The truncated whole part of A.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.

Examples. WORD_UNSIGNED(123) is 123WU.
WORD_UNSIGNED(65537) is 1WU.

WRITE ([UNIT],[ARG]...)

IO. Writes text values to terminal or file.

Arguments Optional UNIT,ARG...
UNIT Character scalar or * for stdout.
ARG... Any type.

Result.. Numeric or text scalars and arrays are converted to
text and output to the selected UNIT. Arrays are
on separate lines; scalars are packed without space
up to the terminal line width. If the data type or
class if nonstandard, DECOMPILE is used to make a
text string that is output.
>>>>>>>>>WARNING, No explicit formatting is provided. You can use
CVT(-1.2,"12345678") to get a string "-1.2E+00" or
DECOMPILE(-1.2) to get "-1.2".

Example.. WRITE(*,'x=',1.2,3,[4,5],6) appears as
x= 1.20000E+00 3
4 5
6

X_TO_I (DIMENSION,[X])

MDS Transform Elemental. Convert index into axis values.

Arguments Optional X.
DIMENSION a dimension with optional window and axis.
If DIMENSION is missing, the unchanged X is returned.
If the window of DIMENSION is missing, the first
axis point is assigned an index of 0.
X scalar or array list of axis values.
(For TDI$X_TO_I, the fake address of -1 for X,
returns a 2-element vector with the index bounds.)

Signals. Same as X.
Units... Same as axis of DIMENSION.
Form.... Same type as DATA(axis). Same shape as X.

Result.. The window and axis are evaluated for each axis point X.
The result is the index value of that point.
Although the window start and end indices may be used
to determine the value of axis points, they do not
limit the range of results.

Examples. X_TO_I(BUILD_DIM(BUILD_WINDOW(2,5,1.1),
BUILD_RANGE(,,3))) is [2,3,4,5] corresponding to axis
[7.1,10.1,13.1,16.1].
X_TO_I(BUILD_DIM(BUILD_WINDOW(2,7,1.1),
BUILD_RANGE(,,3)),[4.1,7.1,10.1,13.1]) is [1.,2.,3.,4.].
The index 1 (axis point 4.1) is outside the valid
window of 2 to 7.

See also. CULL and EXTEND to discard or limit axis points.
I_TO_X for the inverse transform.
NINT to round indices to the nearest integers.

ZERO ([SHAPE],[MOLD])

Transformation. Generate an array of zeroes.

Arguments Optional: SHAPE, MOLD.
SHAPE integer vector.
MOLD any numeric.

Signals. None.
Units... None.
Form.... Type of MOLD and shape (dimensions) is SHAPE.
If SHAPE is absent, the result is a scalar.
If MOLD is absent, the result will be longs.
Result.. The value of each element is 0.

Example. _X = ZERO([2,3,4],1d0) makes an array of
double precision floating point numbers of shape
[2,3,4]. They are all 0d0.

See also. ARRAY, RAMP, and RANDOM.