lock(): int

Synchronizes the behavior of several Zorro instances, f.i. for preventing that they write into the same file at the same time (Zorro S only). If another Zorro has called lock() before, this function waits until it either calls unlock() or the [Stop] key was pressed. In the latter case lock() returns 0, otherwise nonzero.

unlock()

Cancels a previous lock call and let other waiting Zorros continue.

Example (see also putvar/getvar):

lock(); // prevent that other Zorros write into same file
file_append(Name,Text1);
file_append(Name,Text2);
unlock();

See also:

timer, run, wait, suspended, quit, version

► latest version online