omron — $ENCODE string function

$ENCODE string function $ENCODE string function Syntax $ENCODE (output_specification, output_specification, ... ) Function Return a string created from output specifications. The string produced is similar to the output of a TYPE instruction. Parameter An output specification can consist of any of the following components (in any order) separated by commas: 1. A string expression. 2. A real-valued expression, which is evaluated to determine a value to be displayed. 3. Format-control information, which determines the format of the output message. Details This function makes strings normally produced by the TYPE instruction available within a program.

That is, $ENCODE does not generate any output but, rather, creates a string value. The following format specifiers can be used to control the display of numeric values. These settings remain in effect for the remainder of the function parameter list unless another specifier is used. For all these specifiers, if a value is too large to be displayed in the given field width, the field is filled with asterisk characters (*). /D Use the default format, which is equivalent to /G15.8 (see below), except trailing zeros and all but one leading space are omitted. The following format specifications accept a zero as the width field.

This causes the actual field size to vary to fit the value and all leading spaces to be suppressed. This is useful when a value is displayed within a line of text or at the end of a line. /En.m Format values in scientific notation (for example, -1.234E+02) in fields n spaces wide with m digits in the fractional parts. If n is not zero, it must be large enough to include space for a minus sign (if the displayed value is negative), one digit to the left of the decimal point, a decimal point (if m is not zero), m digits, and four eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 199