us_lockΒΆ

us_lock locks the Windows message loop while an UniScript function is executed.

old_lock = us_lock(bLock)

Return Value

old_lock is the value of the lock flag before the function call.

Parameters

bLock

If bLock is TRUE (1) the message loop is locked and if bLock is FALSE (0) the message loop is unlocked.

Comment

If the lock flag is enabled, the execution of a UniScript function cannot be aborted (via ESC key or Ctrl+C). Paint messages are not executed, the UniPlot window is not updated. It is also not possible to start another UniScript command.

If the lock flag is not set to us_lock(FALSE) 5 seconds after us_lock(TRUE) has been called it will be set to FALSE automatically.

The following while loop cannot be interrupted for 5 seconds (Ctrl+C or ESC).

{ us_lock(1); while (1) a=1; }

Example

old = us_lock(TRUE);

// Do something

us_lock(old);

History

Version Description
5.14.5 New.

id-47519