beautypg.com

Scanb – Visara Master Console Center Scripting Guide User Manual

Page 175

background image

Chapter 5 Script Commands

Scripting Guide

175

SCANB

Syntax:

SCANB( %Port, $Text, *Found)

Description:

Searches an OS console for a specified character string. Used with the

BLOCKSCAN() command.

Action:

BLOCKSCAN delineates the beginning and ENDBLOCK delineates

the end of a group of SCANB commands to execute as a group. The
SCANB commands execute simultaneously, and script execution

continues with the branching logic of the first SCANB command that

fulfils its own scanning condition. If the Wait time expires, script
execution branches to the label specified by the *Timeout 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.
*Found. Label literal. The label to jump to when the Text parameter

is found within the time limit specified by the Wait parameter in the
BLOCKSCAN() command.

Returns:

N/A

Notes:

1. QREAD() is the preferred method of scanning a console for

messages. Use SCANB() 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:

//***********************************************
// Example 1
//***********************************************
*START:

BLOCKSCAN(1800, *START, $Msg)

SCANB( 1, “JOBA END”, *JOBA)

SCANB( 2, “JOBB END”, *JOBB)

ENDBLOCK
//***********************************************
// Example 2
//***********************************************
*START:

LOG( LOG_FLT, “JOB A—C REPLY SCAN”)

WAITFOR(

10)

BLOCKSCAN(20, *START, $Msg)

//put 2 digit job # in first cell of $Msg array

SCANB( 2, “\*[0-9][0-9] JOB-A”, *JOBA)

SCANB( 2, “\*[0-9][0-9] JOB-B”, *JOBB)

SCANB( 2, “\*[0-9][0-9] JOB-C”, *JOBC)

ENDBLOCK
*JOBA:

//send job # in pp with reply

KEY( 2, “R “ + $Msg[1] + “,CANCEL[ENT]”)

See Also:

BLOCKSCAN, KEY, QREAD, SCANP