PickBASIC / FlashBASIC
lock statement
.mdThe lock statement sets one of 992 execution locks. This prevents re-entry to the program, allowing only one process to run the program at any given time.
Syntax
Parameter(s)
| lock.num | Specifies the line number (from 0 to 991) to lock. If lock.num is greater than 991, the result is divided by 992, and the lock number is equal to the remainder of the equation. |
Description
The following information applies to the lock statement:
- If the specified lock is found unlocked, the lock statement performs the lock. If present, the then clause is executed.
- If the lock is already locked by another process or by the current process at a different
level, it remains locked.
If present, the else clause is executed.
- If the lock is locked by another process or by the current process at a different level, and no then or else clause is used, the program waits until the lock is unlocked.
- If either a then clause or else clause (or both)
is used, the lock statement will not cause the program to wait.
It is assumed the programmer is doing what they need within the programming clauses.
Note: One beep character is printed if the lock statement waits.
Example(s)
Referenced by
3 topics mention lock statement in its description.