Programming Guide : Writing Scripts and Procedures : How Procedure Handles Work (ProcHandle Objects) : Restrictions to Using the Call Method
 
Share this page          
Restrictions to Using the Call Method
There are some restrictions to using the Call method. This method can be invoked only in the following places:
In a statement by itself
As the right side of an assignment
The Call method can never be invoked inside an expression.
If a procedure handle represents a local procedure that was defined in a frame or global procedure component, there are two additional restrictions on when the Call method can be invoked on the procedure handle:
The Call method cannot be invoked after the frame or global procedure in which it was defined (and which contains the scope on which the GetProcHandle was issued) has terminated.
The Call method cannot be invoked from a “thread” other than the one in which the GetProcHandle was issued.
For example, a frame can create a procedure handle on one of its local procedures and pass it as a callback routine to a called frame, but not to an opened frame (because the openframe statement creates a new thread).
These restrictions do not apply to a procedure handle that represents a global procedure or a local procedure defined in a user class script.