|
IS NUMBERName:
Dataplot determines this by attempting an internal Fortran read. That is (where STR is the string being tested),
If IOSTAT does not indicate an error, then STR is assumed to be a number. If IOSTAT does indicate an error, then STR is assumed to not be a number. Note that there are some strings that are ambiguous in that they can be interpreted as either a valid number or a parameter name. For example, 1D0 will be read successfully as a number, but it is also a valid parameter name in Dataplot. Determining whether this should be considered a number or a parameter will be dependent on the specific application. The basic rule for this command is that if it can be successfully read as a number it will be considered a number.
where <sorg> is a previously defined string; and <ival> is a parameter. The <ival> will be set to 1 if <sorg> is determined to be a number and set to 0 if <sorg> is determined to not be a number.
LET IFLAG = IS NUMBER S1 LET STRING S2 = 34.56 LET IFLAG = IS NUMBER S2
should be coded as
LET IFLAG = IS NUMBER S1
CALL MACRO.DP K=3.56
where MACRO.DP contains
LET STRING SORG = $k
LET IFLAG = IS NUMBER SORG
IF IFLAG = 1; . ARGUMENT IS A NUMBER
LET AVAL = ^SORG
ELSE IF IFLAG = 0; . ARGUMENT IS A STRING
IF SORG EXISTS
LET AVAL = ^SORG
ELSE
LET AVAL = -9999
END OF IF
END OF IF
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 11/10/2020 | ||||||||||||||||||||||||||||||||||||