Initializing help system before first use

waitforend

Purpose
Wait for the end of execution of a model.
Synopsis
procedure waitforend(mo:Model)
procedure waitforend(mo:Model,dur:integer)
Arguments
mo 
A model
dur 
A duration in seconds, the constant WAIT_INFINITE or a timer identifier as a negative integer
Further information
1. This procedure suspends the execution of the caller until a given model has terminated its execution (or returns immediately if the model is not running). The second form specifies a time limit: the processing is suspended for at most dur seconds, the special value WAIT_INFINITE is interpreted as an infinite duration.
2. Before the procedure returns all events received from the model to monitor are removed from the event queue (including the EVENT_END event) unless the time limit has been reached. In this case some of the events of the submodel may have been removed from the event queue.
3. If the time limit is 0 the execution is not suspended but the queue of events is processed once and a subsequent call to waitexpired will return true if the model was still running when the procedure was called (the event queue is not modified in this case).
4. The parameter dur may also take a negative value: in this case it is interpreted as the opposite of a timer identifier (see settimer) and the function will wait until this timer expires if no valid event arrives. When the routine interrupts its monitoring due to the expiration of a timer the first event in the queue is the event EVENT_TIMER associated to this timer. Note that if no timer corresponds to the given value the routine will terminate only when an expected event is available as if WAIT_INFINITE had been used.
Related topics
Module

© 2001-2022 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.