HP 3000 Manuals

BRK [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

BRK 

The BRK function returns the status that BREAK and CONTROL Y (halt) had
before the BRK function was called.  It can also change the status of
these, depending on the value of the argument passed.  BRK is a Boolean
function that returns the value TRUE (one) or FALSE (zero).

Syntax 

BRK (num_expr)

Parameters 

num_expr         This value determines whether BRK changes the status of
                 BREAK and CONTROL Y, as follows:

                 num_expr         Status of BREAK and CONTROL Y

                 Negative         Does not change status

                 Zero             Disables both

                 Positive         Enables both

The BRK function returns:

TRUE (one)       If BREAK and CONTROL Y were enabled before the BRK
                 function was called.

FALSE (zero)     If BREAK and CONTROL Y were disabled before the BRK
                 function was called.

When BREAK is enabled, pressing BREAK causes the operating system to
suspend HP Business BASIC/XL. The operating system command :RESUME
restarts HP Business BASIC/XL. If CONTROL Y is enabled and pressed and a
program is being executed, a message is printed indicating that HALT was
pressed and control is returned to the HP Business BASIC/XL interpreter.
If CONTROL Y is pressed while in the HP Business BASIC/XL interpreter,
only the message is printed.

When BREAK and CONTROLY are disabled, pressing either has no result.

Examples 

     10 Was_enabled=BRK(-1)               !BRK does not change status
     11 Was_enabled=BRK((10+10)-(10*10))  !BRK does not change status
     20 Was_enabled=BRK(0)                !Disables BREAK and CONTROL Y
     21 Was_enabled=BRK((X-Y)-(X+(-Y)))   !Disables BREAK and CONTROL Y
     30 Was_enabled=BRK(1)                !Enables BREAK and CONTROL Y
     31 Was_enabled=BRK(ABS(X))           !Enables BREAK and CONTROL Y
                                          !(if X != 0)
     40 Was_enabled=BRK(X)                !Action depends on value of X
     50 IF BRK(X) THEN GOTO 100           !Action depends on value of X



MPE/iX 5.0 Documentation