Returns an evaluated expression that locks a resource.
|
Syntax:
|
Lock (resource, timeout)
|
Parameters:
|
resource – Any expression that returns an Alpha string. Its maximum length is 128.
|
|
timeout – the maximum wait time in seconds. A negative value equals an infinite wait.
|
Returns:
|
Number to indicate if lock was successful:
|
|
0 = Lock was successful.
|
|
1 = Resource is already locked by same session.
|
|
2 = Resource is locked by another user and the timeout has expired.
|
Note:
|
-
A zero length string is a valid name. In case of a recursive lock, the user must issue an UnLock command for each Lock command to fully unlock the resource.
-
The function polls every 500 milliseconds.
|
See also:
|
The Online and Rich Client Samples projects (program TF08 and RTF08)
|