Documentation:Reference:TDI JKL - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

KIND (A)

MDS/VMS Inquiry. Data type of data storage descriptor.

Argument. A may be any descriptor.

Result.. Byte unsigned of the descriptor data type.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Use KIND for data type without NID, PATH, or variable.
Use KIND_OF for data type including them.

Examples. KIND(3) is 8 (DSC$K_DTYPE_L) on the VAX.
KIND(1.2) is 10 (DSC$K_DTYPE_F) on the VAX.
KIND(_X) is the kind of the value in variable _X.

KIND_OF (A)

MDS/VMS Inquiry. Data type of data storage descriptor.

Argument. A may be any descriptor.

Result.. Byte unsigned of the descriptor data type.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Use KIND for data type without NID, PATH, or variable.
Use KIND_OF for data type including them.

Examples. KIND_OF(3) is 8 (DSC$K_DTYPE_L) on the VAX.
KIND_OF(1.2) is 10 (DSC$K_DTYPE_F) on the VAX.
KIND_OF(_X) is 191 (DSC$K_DTYPE_IDENT) on the VAX.

LABEL (NAME,STMT,...)

Modified CC Statement. Label holder for statements.
Required Usual Form. LABEL NAME : STMT.
Functiom Form LABEL(NAME,STMT,...). May be syntatically invalid.

Arguments
NAME character scalar. Should begin with underscore (_).
STMT statement, simple or compound (like {S1 S2} or
multiple (like S1 S2).

Result.. STMT except ignored in a GOTO that does not match
the LABEL.
Example. IF (_A > 0) GOTO _XX
...
LABEL _XX : ...

LANGUAGE_OF (A)

MDS Operation. Get the language field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_PROCEDURE, the language field.
Otherwise, an error.

LASTLOC (MASK,[DIM])

Transformation. Locate the trailing edges of a set of
true elements of a logical mask.

Arguments Optional: DIM.
MASK logical array.
DIM integer scalar from 0 to n-1, where n is rank of MASK.

Signals. Same as MASK.
Units... None.
Form.... Logical of same shape.

Result.
(i) LASTLOC(MASK) has at most one true element. If there is
a true value, it is the first in array element order.
(ii) LASLOC(MASK,DIM) is found by applying LASTLOC to each of
the one-dimensional array sections of MASK that lie
parallel to dimension DIM.

Examples.
(i) The last array-ordered element
LASTLOC(_M=[0 0 1 0]) is [0 0 0 0].
[0 1 1 0] [0 0 0 0]
[0 1 0 1] [0 0 0 1]
[0 0 0 0] [0 0 0 0]
(ii) The right edge
LASTLOC(_M,1) is [0 0 1 0].
[0 0 1 0]
[0 0 0 1]
[0 0 0 0]

LBOUND (ARRAY,[DIM])

F90 Inquiry. All the declared lower bounds of an array or a specified
lower bound.

Arguments Optional: DIM.
ARRAY any type array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.

Signals. None.
Units... None.
Form.... Integer scalar if DIM is present, otherwise, a vector of
size n.

Result.
(i) LBOUND(ARRAY,DIM) is equal to the lower bound
for subscript DIM of ARRAY. If no bounds is declared,
the result is 0.
(ii) LBOUND(ARRAY) has the j-th component equal to
LBOUND(ARRAY,j) for each j, 0 to n-1.

Examples. LBOUND(_A=SET_RANGE(2:3,7:10,0)) is [2,7] and
LBOUND(_A,1) is 7.

See also UBOUND for upper bound, SHAPE for number of elements,
SIZE for total elements, and E... for signals.

LE (X,Y)

Logical Elemental. Tests for first less than or equal to second.
Usual Forms X <= Y, X LE Y.
Function Form LE(X,Y).

Arguments X and Y must both be numeric or character.
Complex numbers are an error.

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if X is less than or equal to Y; otherwise, false.
A reserved operand is always false. Character are
compared in the processor collating sequence.
>>>>>>>>>WARNING, floating point operations may not match an exact
calculation for nonterminating binary fractions. You
cannot predict that .1+.1<=.2 is true. Integer values
may be truncated when matched to floating numbers.

Example. 2<=2.0 is $TRUE.

LEN (STRING)

F90 Inquiry. The length of a character entity or the number of bytes in
numeric data (extension).

Argument. STRING is any type, scalar or array.

Signals. None.
Units... None.
Form.... Integer scalar.

Result.. The number of characters in STRING if it is scalar or in
an element of STRING if it is an array.

Example. LEN('abcdefghijk') is 11.

LEN_TRIM (STRING)

F90 Character Elemental. Length of the character argument without
trailing blank or tab characters.

Argument. STRING must be character.

Signals. Same as STRING.
Units... None.
Form.... Integer of same shape.

Result.. The number of characters after any trailing blanks or
tabs are removed. If STRING has no nonblanks other than
tabs the result is 0.

Examples. LEN_TRIM(' A B ') is 4 and LEN_TRIM(' ') is 0.

LGE (STRING_A,STRING_B)

F90 Character Elemental. Test whether a string is lexically greater
than or equal to another string based on the ASCII
collating sequence.

Arguments STRING_A and STRING_B must be character.

Signals. Single signal or smaller data.
Units... None, bad if different.
Form.... Logical of compatible shape.

Result.. If the strings are of unequal length, the comparison is
made as if the shorter string were extended on the right
with blanks to the length of the longer string. If
either string has a character not in the ASCII character
set, the result is processor dependent. The result is
true if the strings are equal or if STRING_A follows
STRING_B in the collating sequence; otherwise, false.

Example. LGE('ONE','TWO') is $FALSE.

LGT (STRING_A,STRING_B)

F90 Character Elemental. Test whether a string is lexically greater than
another string based on the ASCII collating sequence.

Arguments STRING_A and STRING_B must be character.

Signals. Single signal or smaller data.
Units... None, bad if different.
Form.... Logical of compatible shape.

Result.. If the strings are of unequal length, the comparison is
made as if the shorter string were extended on the right
with blanks to the length of the longer string. If
either string has a character not in the ASCII character
set, the result is processor dependent. The result is
true if STRING_A follows STRING_B in the collating
sequence; otherwise, false.

Example. LGT('ONE','TWO') is $FALSE.

LIST ([LIST],[VAL1,VAL2,...])

Data type. Create a DTYPE_LIST data item which can be used as a list similar to the use of list objects in python.

Arguments Optional: LIST.
LIST an existing list which the values will be appended to.
VAL1 value of any datatype .
Result.. List similar to python [val1,val2]

Example: LIST(*,1,'ONE',2,'TWO')[0] is 1

A list can also be appended to: _l=LIST(*,1,2);_l=LIST(_l,3,4) = List(*,1,2,3,4)</br>/
A Dict can also be converted to a List item: List(Dict(,1,'one',2,'two'))

LLE (STRING_A,STRING_B)

F90 Character Elemental. Test whether a string is lexically less
than or equal to another string based on the ASCII
collating sequence.

Arguments STRING_A and STRING_B must be character.

Signals. Single signal or smaller data.
Units... None, bad if different.
Form.... Logical of compatible shape.

Result.. If the strings are of unequal length, the comparison is
made as if the shorter string were extended on the right
with blanks to the length of the longer string. If
either string has a character not in the ASCII character
set, the result is processor dependent. The result is
true if the strings are equal or if STRING_A follows
STRING_B in the collating sequence; otherwise, false.

Example. LLE('ONE','TWO') is $TRUE.

LLT (STRING_A,STRING_B)

F90x Character Elemental. Test whether a string is lexically less
than another string based on the ASCII collating sequence.

Arguments STRING_A and STRING_B must be character.

Signals. Single signal or smaller data.
Units... None, bad if different.
Form.... Logical of compatible shape.

Result.. If the strings are of unequal length, the comparison is
made as if the shorter string were extended on the right
with blanks to the length of the longer string. If
either string has a character not in the ASCII character
set, the result is processor dependent. The result is
true if STRING_A follows STRING_B in the collating
sequence; otherwise, false.

Example. LLT('ONE','TWO') is $TRUE.

LOG (X)

F90 Mathematical Elemental. Natural logarithm.

Argument. X must be real or complex, HC is converted to GC.

Signals. Same as X.
Units... None, bad if X has units.
Form.... Same as X.

Result.. Processor approximation to log X (base e). A complex
result is the principal value with imaginary part in the
range -pi to pi. The imaginary part of the result is pi
only when the real part of X is less than zero and the
imaginary part of X is zero.

Example. LOG(10.0) is 2.302581, approximately.

LOG10 (X)

F90 Mathematical Elemental. Common logarithm.

Argument. X must be real. Complex numbers are an error.

Signals. Same as X.
Units... None, bad if X has units.
Form.... Same as X.

Result.. Processor approximation to log X (base 10).

Example. LOG10(10.0) is 1.0 approximately.

LOG2 (X)

Mathematical Elemental. Logarithm, base 2.

Argument. X must be real. Complex numbers are an error.

Signals. Same as X.
Units... None, bad if X has units.
Form.... Same as X.

Result.. Processor approximation to log X (base 2).

Example. LOG2(8.0) is 3.0 approximately.

LOGICAL (A,[KIND])

Conversion Elemental. Convert to a logical. True is 1BU, False is 0BU.

Argument. Optional: KIND.
A integer.
KIND scalar integer type number, for example, KIND($TRUE).
(Today, there is only one logical type.)

Signals. Same as A.
Units... Same as A.
Form.... Logical (byte_unsigned) of same shape.

Result.. True if lowest bit of converted integer is on.
>>>>>>>>>WARNING, truncation does not cause an error.

Example. LOGICAL(_L OR NOT _L) is $TRUE.

LONG (A)

Conversion Elemental. Convert to long (four-byte) integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Long-length integer of same shape.

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

Examples. LONG(123.4) is 123.

LONG_UNSIGNED (A)

Conversion Elemental. Convert to long (four-byte) unsigned integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Long-length unsigned integer of same shape.

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

Examples. LONG_UNSIGNED(123) is 123LU.
LONG_UNSIGNED(-1) is 4294967295LU.

LT (X,Y)

Logical Elemental. Tests for first less or equal to second.
Usual Forms X < Y, X LT Y.
Function Form LT(X,Y).

Arguments X and Y must both be numeric or character.
Complex numbers are an error.

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if X is less than Y; otherwise, false. A reserved
operand is always false. Character are compared in the
processor collating sequence.
>>>>>>>>>WARNING, floating point operations may not match an exact
calculation for nonterminating binary fractions. You
cannot predict that .1+.1<=.2 is true. Integer values
may be truncated when matched to floating numbers.

Example. 2<2.0 is $FALSE.