beautypg.com

Blockscan – Visara Master Console Center Scripting Guide User Manual

Page 84

background image

Chapter 5 Script Commands

Scripting Guide

84

BLOCKSCAN

Syntax:

BLOCKSCAN( %Wait, *Timeout [, $Array]) ...ENDBLOCK

Description:

Enables up to 256 SCANB() commands to execute as a group.

Action:

BLOCKSCAN delineates the beginning and ENDBLOCK delineates

the ending of a group of SCANB() commands to execute as a group.
The SCANB() commands are executed simultaneously and script

execution continues with the branching logic of the first SCANB()
command that fulfills its own scanning condition. If the Wait time

expires, script execution branches to the label specified by the

*Timeout parameter.

Parameters:

%Wait. Numeric expression. The number of seconds to wait before

timing out when none of the SCANB() commands are successful. This
number specifies how long the command waits for the scans to be

successful.
*Timeout. 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 in a SCANB()

command. 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:

Only SCANB() commands are allowed in the BLOCKSCAN() statement.

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]”)