2. Writing Scripts and Procedures : How Procedure Handles Work (ProcHandle Objects) : How You Can Create a ProcHandle Object
 
Share this page                  
How You Can Create a ProcHandle Object
To obtain a ProcHandle object, invoke the GetProcHandle method on a Scope object. The syntax is:
prochandle = scope.GetProcHandle(name = string);
string
Specifies a literal string or a string variable that specifies the name of a procedure.
scope
Specifies where the procedure:
Is visible
Is to be executed
Generally, the scope of a ProcHandle object is CurScriptScope (the context of the currently executing field script) or CurFrame.Scope. To create a ProcHandle object for a global procedure named identically to a local procedure, use a global scope to represent the current application (CurSession.Scope).
If the currently executing frame or procedure is part of an included application, CurSession.Scope represents the global scope for that included application and the global scopes for all applications directly included by that application.
The names of included applications can be specified explicitly. For example, the following code fragment gets the procedure handle for a procedure named procname defined for an application named appname. The procedure handle is put into a variable named handle:
handle = CurSession.Scope.GetProcHandle
        (Name = 'appname!procname');
Note:  appname must reference an application directly included by the currently active application.