New (ProcedureInfo constructor): Difference between revisions
m (→Usage notes) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 28: | Line 28: | ||
%procInf = %procInf:new | %procInf = %procInf:new | ||
</p> | </p> | ||
<li>To | <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: | <li>The <var>In</var> named argument specifies the file or group name containing the procedure; this name can optionally be preceded by: | ||
<table> | <table> | ||
Line 49: | Line 49: | ||
<li>Otherwise, the name must be that of an open file, and the procedure is located in that file. | <li>Otherwise, the name must be that of an open file, and the procedure is located in that file. | ||
</ul> | </ul> | ||
Wherever the procedure is located, | 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 (ProcedureInfo function)|lastUpdateTime]]('YYYYMMDDHHMISS') | printText {%procInfo:name} {%procInfo:[[LastUpdateTime (ProcedureInfo function)|lastUpdateTime]]('YYYYMMDDHHMISS') | ||
... | |||
</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:
FILE The named file must be open, and the procedure is located in that file. GROUP The 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 GROUP The named TEMP group must be open; the procedure is located in that group's PROCFILE. PERM GROUP The 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