INTREQUEST - ***DELETED*** use NOBRKS or .COBRK.

Usage:

extrn .ireq;
intrequest();
intrequest(stack, function, a1, a2, ... );

Description:

INTREQUEST is intended to provide a reasonably nice ability to B programs to intercept and handle break requests. In its most simple form, INTREQUEST manages an external word .IREQ. Each call to INTREQUEST initializes this word to zero, and also sets indicators so that INTREQUEST will get control from TSS on a break. Each time that a user hits "break", .IREQ is incremented by one; if this value ever reaches 4, INTREQUEST will type the message "QUIT" on the terminal, and exit to TSS.

Thus, a programmer who simply wishes to check an indicator to find out if the user has hit the "break", need only use the first form of call to INTREQUEST to initialize break processing, and then test .IREQ for a non-zero value during execution. He also will probably want to reset .IREQ to zero, so as to be able to continue this past 4 breaks.

On the other hand, a programmer may wish to receive control asynchronously with the execution of his program when the user hits "break". The second form of INTREQUEST call is used for this: the programmer provides a function to be executed when break is hit, and a set of arguments with which this function is to be called. He must also provide a "stack" - a vector of words to be used by INTREQUEST as a run-time stack for "function"; the normal B stack may not be used for this purpose. Note that the arguments to the function are evaluated at the time that INTREQUEST is called. Thus, if the function is to have access to a dynamically changing value, the address of the value must be passed to INTREQUEST.

Successive calls to INTREQUEST do not stack requests for break processing, but rather supercede any previous requests.

Notes:

Depending on the state of the main program at the time the asynchronous function is called, the second form of INTREQUEST may lead to strange results. The best idea is to have the asynchronous function do as little as possible.

See Also:

expl b lib nobrks

expl b lib .cobrk

Copyright © 1996, Thinkage Ltd.