Access Statement


Requests access to shared variables.


access share-var [,share-var]... statements
Variable Description
share-var The identifier of a shared variable. More than one shared variable can be requested by separating them with commas.
statement One or more statements to be executed when access to all specified share-vars is granted.


At any point in the execution of a script, a shared variable can be accessed only from within the block of code that has explicitly been granted access to it. Request access to shared variables by using the access statement.

If no other thread currently has access to any of the shareable variables listed, 4Test executes the specified statements. Otherwise, 4Test blocks the thread where the access statement occurs until access can be granted to all the shareable variables listed. At that point, 4Test blocks competing threads and executes the blocked thread.


share integer iTestNum = 0
public share string as WeekDay [7]
share anytype aWhoKnows
void IncrementTestNum
access iTestNum 
iTestNum = iTestNum + 1