SUBSTITUTE FORMAT
Name:
Type:
Purpose:
When using the substitution character (^ by default) to substitute
the value of a parameter in a command line, specify a Fortran style
format specification for the parameter.
Description:
The substitution character, "^", is used to substitute the value of a
parameters into a command line. If you want to specify the maximum
level of control over how that parameter is expanded, you can use
command to specify a Fortran style format specification. This will
either be a F format (e.g., F7.2) or a an E format (E12.5). The
format is for a single parameter and is limited to eight characters.
If a command line has multiple parameters to substitute, they will all
use the same format specification. The format specification is not
used when substituting the values of character strings.
The F format has the syntax Fw.d where w is the width of the field
and d is the number of digits to the right of the decimal point. The
E format is Ew.d where w is the width of the field and d is the
number of digits. For example,
let a = 876213.762
set substitute format e15.7
let string b = a: ^a
will result in the string
Syntax:
SET SUBSTITUTE FORMAT <string>
where <string> is a character string of 1 to 8 characters.
To turn this option off, enter
SET SUBSTITUTE FORMAT OFF
Examples:
SET SUBSTITUTE FORMAT F7.2
SET SUBSTITUTE FORMAT E12.5
Note:
Dataplot uses the specified format with an internal Fortran WRITE
statement. That is
WRITE(ISTR,IFORMT,ERR=statement)VAL
where IFORMT is the specified format and VAL is the value of the
parameter. Dataplot does no parsing or error checking on the
specified format. Typically, only F, E, or G formats should be used.
If there is an error using the Fortran format specification, Dataplot
will revert to its default parameter expansion (no error message will
be generated). The format string is limited to a maximum of 8
characters and the maximum number of characters for the expanded
parameter is 20.
Note:
If you want to use different format specifications on a single
command line, you can do something like the following
SET SUBSTITUTE FORMAT F7.4
LET STRING S1 = ^a
SET SUBSTITUTE FORMAT F5.1
LET STRING S2 = ^b
TITLE A: ^S1, B: ^S2
Note:
The SET PARAMETER EXPAND DIGITS and SET PARAMETER EXPANSION are
alternative ways to control how parameters are expanded.
Default:
No format specification will be used
Synonyms:
Related Commands:
|
^
|
=
|
Substitution character.
|
|
SET PARAMETER EXPAND DIGITS
|
=
|
Specify the number of digits to the right of the decimal
point when parameters are substituted.
|
|
SET PARAMETER EXPANSION
|
=
|
Specify whether parameters are expanded into a numeric or
exponential format.
|
Applications:
Implementation Date:
Program:
LET A = 23.46789
SET SUBSTITUTE FORMAT F7.2
LET STRING B = A: ^A
PRINT B
The following output is generated
FUNCTIONS--
B --A: 23.47
Date created: 09/18/2024
Last updated: 09/18/2024
Please email comments on this WWW page to
[email protected].
|
|