New (ProcedureInfo constructor)

From m204wiki
Revision as of 20:25, 18 April 2013 by Dme (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create a new ProcedureInfo instance (ProcedureInfo class)

[Introduced in Sirius Mods 7.8]


Syntax

%procedureInfo = [%(ProcedureInfo):]New( In= string, Name= string)

Syntax terms

%outProcedureInfo A ProcedureInfo object variable. If the procedure identified by this method's parameters is not found, New returns a Null object.
[%(ProcedureInfo):] The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a ProcedureInfo Constructor.
In This required, name required parameter is a string that specifies the file or group that contains the procedure whose information is being extracted. See the "Usage notes" below.
Name This required, name required, parameter is a case-sensitive string that contains the exact name of the procedure whose information is being extracted.

Usage notes

  • As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:

    %procInf = new %procInf = %(ProcedureInfo):new %procInf = %procInf:new

  • To obtain the information of multiple procedures, you can use the List method.
  • The In named argument specifies the file or group name containing the procedure; this name can optionally be preceded by:
    FILEThe named file must be open, and the procedure is located in that file.
    GROUPThe named group must be open.
    • If a TEMP GROUP by that name is open, the procedure is located in that group's PROCFILE.
    • Otherwise (a PERM GROUP by that name must be open), the procedure is located in that group's PROCFILE.
    TEMP GROUPThe named TEMP group must be open; the procedure is located in that group's PROCFILE.
    PERM GROUPThe named PERM group must be open; the procedure is located in that group's PROCFILE. Also, a TEMP GROUP by that name must not be open.

    If a single word is provided for In (that is, none of the keywords in the above table precedes the name):

    • If it is the direct result of $Curfile or $Update, then the procedure is located in the file by that name, whether or not a group with the same name is open. The file must be open. An example of the direct use of $Curfile is:

      %proc = new(in=$curfile, name=%s)

      The following is not a direct use; if there is a group open with the same name as the value of $Curfile, the procedure is located in that group:

      %f = $curfile %proc = new(in=%f, name=%s)

    • Otherwise, if the name is that of an open TEMP group, the procedure is located in that group's PROCFILE.
    • Otherwise, if the name is that of an open PERM group, the procedure is located in that group's PROCFILE.
    • Otherwise, the name must be that of an open file, and the procedure is located in that file.

    Wherever the procedure is located, CURPRIV for the group or file must be open with the X'0200' bit set.

Examples

... %procInfo=New(name='SSLP-REQ', in='FILE MYFILE') printText {%procInfo:name} {%procInfo:lastUpdateTime('YYYYMMDDHHMISS') ...

The statements above produce a result like:

SSLP-REQ 20110715094616

See also