Scanp – Visara Master Console Center Scripting Guide User Manual
Page 176
![background image](https://www.manualsdir.com/files/808700/content/doc176.png)
Chapter 5 Script Commands
Scripting Guide
176
SCANP
Syntax:
SCANP( %Port, $Text, %Wait, *Found[, $Array])
Description:
Searches an OS console for a specified character string.
Action:
A console is scanned for a regular expression match. Script execution
can branch depending on whether the scan was successful within a
specified time limit. If found within the number of seconds specified by
the Wait parameter, script execution continues with the next
statement. If not found within the number of seconds specified by the
Wait parameter, script execution jumps to the label specified by the
*Found parameter.
Parameters:
%Port. Numeric expression. The assigned console port number to
scan. Refer to the Overview chapter for more information.
$Text. Regular expression. The text expression to scan for in the
console. Refer to Regular Expressions on page 54 for more information.
%Wait. Numeric expression. The number of seconds to wait before
timing out when the Text parameter is not found. This number
specifies how long the command waits for the scan to be successful.
*Found. Label literal. The label to jump to when the Wait time
expires.
$Array. Normal string array. Optional. The array to populate with
subexpression results, if any, from the Text parameter. Each array
element will contain one subexpression result—element one will hold
the result for subexpression one, element two will hold the result for
subexpression two, and so on. The subexpressions are “numbered”
from left to right in the Text parameter. $Array is only populated
when the Text parameter contains subexpressions and the scan text is
found. Only the first nine subexpression results can be returned.
Returns:
N/A.
Notes:
1. QREAD() is the preferred method of scanning a console for
messages. Use SCANP() only if the desired messages are not
coming out of a printer console.
2. The position of the scan text on the console and character
attributes (for example, only highlighted characters) cannot be
specified.
Example:
See BLOCKSCAN command.
See Also: