BBjConfig::suppressUIAckBack

Description

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

Syntax

Return Value

Method

void

suppressUIAckBack(boolean shouldSuppress)

Parameters

Variable

Description

shouldSuppress

Specifies whether suppression should be turned on or off.

0 = No suppression (False)

1 = Suppression (True)

Return Value

None.

Remarks

If suppressUIAckBack() is set to the default value of FALSE, the Interpreter will wait for an acknowledgement after each command sent to a user interface object (SysWindow, Console, SysGui) and will also wait for a response after each WRITE command to a sysgui or console channel. The Interpreter will not execute the next program statement until the acknowledgement is received. If the command generates an error, the Interpreter will execute appropriate error branching.

If suppressUIAckBack() is set to TRUE, the Interpreter will only wait for a response from the user interface if the command is a query (e.g.: X$=CTRL(SYSGUI); TEXT$=myButton!.getText()). It will not wait for a response if the command is not a query (e.g.: PRINT(SYSGUI)'FOCUS'(0); PRINT 'CS'; myButton!.setText("hello")).

Suppressing UIAckBack can provide significant improvement in UI responsiveness, especially when the client is connected over a low-speed connection. However, if the Interpreter is not waiting for an acknowledgement from the client, some errors that occur on the client will not be recognized by the Interpreter and so the Interpreter will not execute appropriate error branching. Therefore, this should only be done with programs that are known to be correct.

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,"Red",$0800$, err =dupButton);

rem 'after calling suppressUIAckBack(TRUE) bbj will no longer take the error branch
print "SysGui allowed me to add duplicate button"
ESCAPE

dupButton:
    print "received error : duplicate button"
    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.