BBjConfig::suppressPrinterAckBack

Description

Controls whether the Interpreter waits for a response from the printer before processing the next program statement.

Syntax

Return Value

Method

void

suppressPrinterAckBack(boolean shouldSuppress)

Parameters

Variable

Description

shouldSuppress

Specifies whether to turn suppression on or off.

0 = No suppression (False)

1 = Suppression (True)

Return Value

None.

Remarks

When BBj opens a printer channel that is writing to a printer device on the client, there are two Java Objects involved; the PrintDelegateStub, which resides on the server and the PrintDelegateImpl, which resides on the client. In response to a PRINT in the BBj program, the Interpreter sends a command to the PrintDelegateStub. The PrintDelegateStub then sends a message to the (remote) PrintDelegateImpl, which communicates to the printer device itself. If any error occurs, the PrintDelegateImpl returns an error message to the PrintDelegateStub. This results in an error condition within the BBj program. If no error occurs, then the PrintDelegateImpl sends an ACK message back to the PrintDelegateStub.

If suppressPrinterAckBack is set to FALSE, then the Interpreter will not execute the next program command until it receives either an error or an ACK from the PrintDelegateImpl. If suppressPrinterAckBack is set to TRUE, then the interpreter will execute the next program statement without waiting for an error message or an ACK from that channel.

Example

rem 'Add a button to a window

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Open the SysGui device
SYSGUI = UNT
OPEN (SYSGUI)"X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 200
HEIGHT = 200
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

rem 'Add a button on the window
myRedButton! = myWindow!.addButton(101,50,100,90,30,"Red",$0800$)

rem 'adding another button with same ID should fail
print "attempting to add a duplicate button"
dupButton! = myWindow!.addButton(101,50,100,90,30,"Blue",$0800$,err = dupButton)

rem 'after calling suppressUIAckBack(TRUE) bbj will no longer take the error branch
print "Error was suppressed"
ESCAPE

dupButton:
    print "received error: ",errmes(-1)
    print "suppressing errors and trying again"
    myAPI!.getConfig().suppressUIAckBack(myAPI!.TRUE)
retry

See Also

BBjAPI

BBjConfig

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.