New (ProcedureInfo constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 14: Line 14:


<tr><th><var>In</var></th>
<tr><th><var>In</var></th>
<td>This required, [[Notation conventions for methods#Named members|name required]] parameter is a string that specifies the file or group that contains the procedure whose information is being extracted. To access a group, use the keyword <var>Group</var> after <var>In</var>: <code>In Group <i>mygroup</i></code>.</td></tr>
<td>This required, [[Notation conventions for methods#Named members|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|"Usage notes"]] below.</td></tr>


<tr><th><var>Name</var></th>
<tr><th><var>Name</var></th>
Line 28: Line 28:
%procInf = %procInf:new
%procInf = %procInf:new
</p>
</p>
<li>To provide a single display of the information of multiple procedures, you can use the <var>[[List (ProcedureInfo function)|List]]</var> method.
<li>To obtain the information of multiple procedures, you can use the <var>[[List (ProcedureInfo function)|List]]</var> method.
<li>The <var>In</var> named argument specifies the file or group name containing the procedure; this name can optionally be preceded by:
<table>
<tr><th>FILE</th><td>The named file must be open, and the procedure is located in that file.</td>
</tr>
<tr><th>GROUP</th><td>The named group must be open.<ul><li>If a <var>TEMP GROUP</var> by that name is open, the procedure is located in that group's <var>PROCFILE</var>.<li>Otherwise (a <var>PERM GROUP</var> by that name must be open), the procedure is located in that group's <var>PROCFILE</var>.</ul></td></tr>
<tr><th>TEMP GROUP</th><td>The named <var>TEMP</var> group must be open; the procedure is located in that group's <var>PROCFILE</var>.</td></tr>
<tr><th nowrap>PERM GROUP</th><td>The named <var>PERM</var> group must be open; the procedure is located in that group's <var>PROCFILE</var>.
Also, a <var>TEMP GROUP</var> by that name must <b>not</b> be open.</td></tr>
</table>
If a single word is provided for <var>In</var> (that is, none of the keywords in the above table precedes the name):
<ul>
<li>If it is the <b>direct</b> result of <var>$Curfile</var> or <var>$Update</var>, 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 <i>direct</i> use of <var>$Curfile</var> is:
<p class="code">%proc = new(in=$curfile, name=%s)</p>
The following is not a <i>direct</i> use; if there is a group open with the same name as the value of <var>$Curfile</var>, the procedure is located in that group:
<p class="code">%f = $curfile
%proc = new(in=%f, name=%s)</p>
<li>Otherwise, if the name is that of an open <var>TEMP</var> group, the procedure is located in that group's <var>PROCFILE</var>.
<li>Otherwise, if the name is that of an open <var>PERM</var> group, the procedure is located in that group's <var>PROCFILE</var>.
<li>Otherwise, the name must be that of an open file, and the procedure is located in that file.
</ul>
Wherever the procedure is located, <var>CURPRIV</var> for the group or file must be open with the X'0200' bit set.
 
</ul>
</ul>


==Examples==
==Examples==
<p class="code">   ...
<p class="code">...
%procInfo=New(name='SSLP-REQ',  in='FILE MYFILE')                     
%procInfo=New(name='SSLP-REQ',  in='FILE MYFILE')                     
printText {%procInfo:name} {%procInfo:lastUpdateTime('YYYYMMDDHHMISS')
printText {%procInfo:name} {%procInfo:[[LastUpdateTime (ProcedureInfo function)|lastUpdateTime]]('YYYYMMDDHHMISS')
  ... </p>
...
</p>


The statements above produce a result like:
The statements above produce a result like:

Latest revision as of 20:25, 18 April 2013

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