Wait for the object signal.
[ bAcquired = ] Object.Lock ( [lTimeOut] )
The Lock method syntax has the following parts:
|
Name |
Type |
Description |
|
Object |
AEvent |
AEvent object |
|
lTimeOut |
Val Variant |
The length of time in milliseconds to attempt to wait for the object signal. |
|
bAcquired |
Bool |
A boolean expression that specifies whether the object is acquired. |
bAcquired can be one of the following:
|
Value |
Description |
|
True * |
The AEvent object is acquired. |
|
False |
The AEvent object is not acquired. |
The following statement waits for the AEvent object signal for 200 milliseconds before attempting to access the controlled resources:
if (event1.Lock(200))
! Access protected resources
! Reset (unsignal) the event object when finished accessing the protected resource
event1.ResetEvent
endif