26.12.2012 Views

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.4.1.6 String Format Specification<br />

<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />

The Macro Language, String Format Specification<br />

String formatting is used to read and write variables to external files, and to write information to<br />

the verification listing. Output string formatting converts variables to a text string. Input string<br />

formatting extracts information from a text string and loads it into variables.<br />

Output String Format Specifications<br />

String formatting is used to transfer different data types into a text format depending upon<br />

certain control characters in the format string. The format processing described below is used by<br />

the $FSWRIT function, and also by the ERROR and WRITE commands.<br />

A format string is made up of two separate parts. The first part is a character string that may or<br />

may not have certain control characters. The second part is a list of arguments that are to be<br />

formatted into the first part of the format string. The number of arguments required for the<br />

second part depends upon the number of control characters in the first.<br />

The following sections describe the action taken when certain control characters are found in the<br />

first part of the format string. Each control character may require a different type of argument in<br />

the second part of the format string. The type required will be described in the pertinent section.<br />

The exclamation character (!) is used as an attention character to indicate that the characters to<br />

follow are to be validated as formats for different argument types. If an exclamation character is<br />

required on the output string, specify two exclamation characters (!!). All formats should be<br />

placed in open and close parentheses. For example, “!(s4.3s)”.<br />

Numeric Output Format<br />

(!<br />

� �<br />

�� X�� V<br />

��� �s�<br />

n<br />

�.<br />

�<br />

n<br />

�s�<br />

)<br />

�� e��<br />

�� f��<br />

�� e��<br />

V Output as variable length string (default)<br />

X Output as fixed length string<br />

+ Output + sign for positive numbers<br />

s Suppress leading/trailing zeros<br />

e One digit must appear left or right of decimal<br />

n Maximum number of digits left or right of decimal<br />

. Always output decimal<br />

f Omit decimal point for whole numbers<br />

This format is used to place a value into the character string using a given “format”. This format<br />

requires a numeric argument for each occurrence of the format. This value can be any numeric<br />

value. The macro processor will take this value and format it using the specified “format”. The<br />

“format” can be in the following appearance.<br />

The “V” or “X” character provides for optional fixed length output. When using the X format,<br />

leading and trailing zeroes that are converted to blanks will remain significant. This is useful<br />

when outputting tables of values that should be aligned. The default is variable length output.<br />

The V format character can be omitted.<br />

<strong>ICAM</strong> Technologies Corporation – Proprietary 139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!