Runtime.WaitForSignal

Prototypes

static boolean WaitForSignal( String sName <, int nTimeout > )

Return Value

If the signal is set before the timeout period elapses, the return value is true. If the signal is not set before the timeout period elapses, the return value is false.

Parameters

String sName
The name of the signal to wait for.

int nTimeout
An integer specifying the number of milliseconds to wait. If nTimeout is 0, the method does not wait for the signal to be set. The method returns the status of the signal immediately. If nTimeout is -1, the method waits forever for the signal to be set. Calling this method without specifying the nTimeout parameter is equivalent to calling it with nTimeout equal to -1.

Remarks

This method waits for a signal to be set by another IMLPlus program.

A signal enables an IMLPlus program to communicate the occurrence of a significant event to another IMLPlus program. A signal is created on-demand when its name is used with one of the Signal methods. A signal is always in one of two states: Set, or Clear. All signals are created in the Clear state. To configure a signal to the Set state, call the method Runtime.SetSignal. To configure a signal to the Clear state, call the method Runtime.ClearSignal. To halt further program execution until a signal is set, call the method Runtime.WaitForSignal. To halt further program execution until multiple signals are set, call the method Runtime.WaitForMultipleSignals.

Example
run GetPersonalFilesDirectory( PathName );
PathName = PathName + "Programs\DynamicallyGeneratedProgram.sx";

ProgramText = { "Runtime.Delay( 3000 );",
                "Runtime.SetSignal( 'Done' );" };

Runtime.WriteProgramFile( PathName, ProgramText );
Runtime.ClearSignal( "Done" );
Runtime.RunProgramFile( PathName, "", false, true, 1 );
Runtime.WaitForSignal( "Done" );
print "Other program finished";
See Also

Runtime.ClearSignal

Runtime.SetSignal

Runtime.WaitForMultipleSignals