Access Statement

Action

Requests access to shared variables.

Syntax

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.

Notes

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.

Example

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