file text write

Indicates that output composed of the values_for_output is to be sent to the specified destination, using the given format.

Format:

 
file text write
file_name =
string
variable_name =
an existing vvar
format_for_output =
string
values_for_output =
string
newline =
boolean

Example:

 
file text write &
format_for_output =
"the varmint is a %s, kill it %s." &
values_for_output =
"snake", "now"

Description:

 
Parameter
Value Type
Description
file_name
String
Specifies the name of the output text file.
variable_name
An Existing Vvar
Specifies a variable to which Adams View stores a formatted string.
format_for_output
String
Specifies the format for the output text.
values_for_output
String
Specifies the values that are to be placed in the output string.
newline
Boolean
Controls whether or not the command causes the output to terminate the line with this write command.

Extended Definition:

1. The destination depends on what you specify, a file_name or a variable_name. You may specify neither, one, or both destinations. If writing to a file, you must open it first.
If you specify neither, Adams View assumes the last opened or written file as the intended destination. If you specify just the file_name, Adams View writes the output to that file. If you specify just the variable_name, Adams View assigns the text string to that variable. If you specify both, Adams View performs both actions.
2. The proper extension for file_name parameter is the default (.txt) but can be overridden by simply supplying a different extension.
You do not need to enclose the file name in quotes if it only contains alpha-numeric characters and starts with a letter. If you want to include other characters, such as a '.' for an extension or '/' or '[]' for directory paths, you must enclose the name in quotes.
3. Output formats are a mixture of text and conversion specifications. Each conversion specification usually has a matching argument in the values_for_output parameter. A conversion specification begins with a percent sign, '%', and is terminated by a letter or another percent sign.
FILE TEXT WRITE &
  FORMAT_FOR_OUTPUT="The varmint is a %s, kill it %s." &   VALUES_FOR_OUTPUT="snake", "now"
Generates the string "The varmint is a snake, kill it now." to be written to the appropriate file or variable. Note that there are two conversion specifications (both '%s') and two values for output.
The conversion specifications provided by Adams View are a subset of those used in the ANSI-C programming language.
Valid conversion specifiers are:
% literal percent sign ("%%" is output as "%")
d integer in base 10, 1 or 123
e exponential floating point, 1.23e-04
E exponential floating point, 1.23E-04
f fixed point real, 345.67
g general fixed or floating point (depending upon magnitude)
G general fixed or floating point (depending upon magnitude)
i same as d, above
o unsigned integer in base 8 (o is for octal)
s character string
u unsigned integer in base 10
x unsigned integer in base 16 (decimal 10 is 'a', 11 is 'b', etc.)
X unsigned integer in base 16 (decimal 10 is 'A', 11 is 'B', etc.)
Most conversion specifications may contain flags between the leading percent sign and the terminating conversion specifier. These flags allow you to tune the format of your output further.
Some of the valid flags are:
- Indicates that the output is to be left justified in the field, with the default being right justification. This is only useful when the field width is specified, see below.
+ Force a sign to be output for all numeric values.
     ... FORMAT="%+d %+d" VALUES=(-1), (1)produces -1 +1
0 Forces output of leading zeros when a field width is specified.
Field width is specified by prefixing the conversion specifier with a number. It determines how much space is to be reserved for the output text. The following format and values
... FORMAT="%03d%6d" VALUES=(5),(6) generates"005.....6"as output, where '.' denotes blank space (in this example only).
You specify precision with a number and decimal point following the field width prefix. For instance,
... FORMAT="%5.2f %010.3e" VALUES=(2.3),(5.4)produces the output:
" 2.30 05.400e+00"
Adams View converts the values for output to the appropriate type for the conversion specifier. Use of expressions is extremely useful here.
4. If newline is NO, then subsequent WRITEs will produce output along the same line. If newline is YES , then any succeeding WRITE command will write on a new line. This parameter is optional and has a default value of YES.