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:

lock(); // prevent that other Zorros write into file "name"
file_append(name,mytext1);
file_append(name,mytext2);
unlock();

See also:

timer, run, wait, quit, version

► latest version online