Loading...
 

WaitOnInput

WaitOnInput

WaitOnInput, WaitOnInput(interval)

parameters: time-out interval in seconds

Stack
Stack Position Description
Stack(In) Top any
Stack(Out) Top Values of FinishInput

The InstantView® interpreter does not initially execute the statements following WaitOnInput, but stops processing the call stack. From now on, the interpreter processes newly occurring events and previously accumulated PostMsg calls, i.e. it can react to user interaction, for example. The FinishInput instruction ends the waiting state. The instruction following WaitOnInput then receives the control. The values that FinishInput found are on the stack.

The values that were on the stack before WaitOnInput are lost.

With the instruction pair WaitOnInput-FinishInput, the event-oriented sequence of InstantView® can be broken up. This is useful when user responses are needed within the programme flow.

The internal operation of WaitOnInput is described in more detail here.

If a CloseWindow was executed before WaitOnInput, the final closing of the window is delayed for the period of WaitOnInput.

Timeout

WaitOnInput without parameter specification waits as long as desired. The waiting time can be limited by specifying a time interval n: If after n seconds neither a keyboard nor a mouse event is registered, the instruction following WaitOnInput is executed.

Changed behaviour
As of Dll version 225253Before Dll version 225253
WaitOnInput does not terminate the running transaction. It is implicitly terminated when the runtime (within WaitOnInput) is idle.
If there is no PostMsg in the RequestQueue, then the transaction is terminated practically immediately, because the Runtime is idle due to WaitOnInput.
Since PostMsg requests are processed immediately within WaitOnInput, they are processed in the same transaction.
WaitOnInput (without KEEP) directly terminates the current transaction (commit),
in order not to block the database by WaitOnInput.
Newly started transactions within WaitOnInput can only be terminated by an explicit EndTXN . The transaction is not implicitly terminated as soon as the runtime is idle.


InstantView® code can be triggered by messages sent by a method of a persistent object (a C++ function), i.e. C++ code of the function is executed again at the end of the instruction sequence.
In this case, the running database transaction must not be terminated under any circumstances, because this would invalidate the affected object and cause the system to crash. In this case, ClassiX prevents the transaction commit within WaitOnInput, which is also logged accordingly in the cx.txn logger.

KEEP parameter

WaitOnInput(, KEEP), WaitOnInput(interval, KEEP)

parameters: time-out interval in seconds

Stack
Stack Position Description
Stack(In) Top -
Stack(Out) Top Values for FinishInput

The only difference to WaitOnInput without parameter KEEP is the following:

WaitOnInput(, KEEP) keeps a running database transaction open for the entire duration of WaitOnInput.
This can lead to locking conflicts!

Examples for both variants can be found here.