Skip to main content

Lock Command and $Test

In ObjectScript, the $Test system variable gets set when the system runs certain commands, such as Lock, when used with a timeout. The value of this variable is either 0 (false) or 1 (true).

You can use a timeout (in seconds) on Lock, so that it doesn't wait forever. If the Lock is unsuccessful in the allotted time, the system sets the $Test variable to 0. You can then check the value of $Test.

SAMPLES>lock +^x(1):5

SAMPLES>if ('$test) { write "Try again later." }
Try again later.
FeedbackOpens in a new tab