Qpreview – Visara Master Console Center Scripting Guide User Manual
Page 166
Chapter 5 Script Commands
Scripting Guide
166
QPREVIEW
Syntax:
QPREVIEW( %QueueID, $ResultArray) ==> %RetCode
Description:
For non-mainframe printer queues, this command read or “previews”
the text on the current line before it is added to the message queue
(that is, before a carriage return is sent). The text returned is
essentially a “snapshot” of the line on the screen as it is being built. It
may be a complete message; alternatively, it may be an incomplete
message, with more text being added after the snapshot is taken.
Action:
The current line of the screen is read and the text is returned as a
string. The message source (the OS name the message came from)
becomes the key for the $ResultArray parameter, and the current
previewed message becomes its value.
Parameters:
%QueueID. Numeric expression. The message queue from which to
read the message. This is the unique queue ID created by QOPEN().
$ResultArray. Associative string array. The array is associatively
indexed with the message source (the OS name that the message came
from), and assigned the current message pending on the console. Each
OS in the %QueueID has an entry in this array.
Returns:
String value in $ResultArray, and error code in %RetCode, as follows:
Value
Meaning
-1
An error occurred. The preview text was not
read.
0
Success. The preview text was not read.
If %RetCode is -1, the ERRORNUM function returns one of the
following values:
Error Code
8
5200
5201
Manifest Constant
ERR_BADQUEUEID
ERR_QPREVIEW_COMMERROR
ERR_QPREVIEW_NORESPONSE
Description
The queue ID passed
is invalid.
Iclrun could not
communicate with
Serial Manager.
Iclrun did not
receive responses
from Serial Manager
for all of the ports it
was trying to
preview.
Notes:
1. QPREVIEW() only reads messages from serial printer console
queues created with the QOPEN() command.
2. If used on a mainframe printer console queue, QPREVIEW()
returns an empty string in $ResultArray.
3. There is no guarantee that the expected prompt will be in the
queue at the time QPREVIEW() is executed, due to timing and
other host-related issues. Additional keys may need to be sent to
the host to produce the desired prompt. (For instance, if you are
waiting for a “Login:” prompt and a user is already logged in on the