PARSE_STATUS

Parses an Adams message file (usually with an .msg extension), and returns an array of integer status codes corresponding to the given search tag.

Format

PARSE_STATUS(fileName, tag)

Arguments

 
fileName
Name of the message file in which to search for status codes.
tag
Character string indicating the status coes to extract.

Examples

A typical message file contains pairs of lines that look like the following:
ALVSIM:STATUS
Simulate status=0
or
A3TERM:STATUS
Termination status=-995
This function finds lines that match the contents of tag, and returns the numeric value following the equal sign on the line following the tag match. It does this for the entire file, returning an array of status codes, in the order in which it found them.
For example, if the above lines were to appear in test.msg, then you could execute the following command and receive an array containing a single element, -995, as the result:
variable create variable=status integer=(parse_status("test.msg", "A3TERM:STATUS"))
 
Tip:  
Use the LAST function if you want to retrieve only the final value. You could change the example on the previous page to read as follows if you want to retrieve only the final value in the file:
variable create variable=finalStatus &
integer=(last(parse_status("test.msg", "A3TERM:STATUS")))