New (ProcedureInfo constructor): Difference between revisions
mNo edit summary |
No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:ProcedureInfo:New subtitle}} | {{Template:ProcedureInfo:New subtitle}} | ||
==Syntax== | ==Syntax== | ||
{{Template:ProcedureInfo:New syntax}} | {{Template:ProcedureInfo:New syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%outProcedureInfo</th><td> | <tr><th>%outProcedureInfo</th> | ||
<td>A <var>ProcedureInfo</var> object variable. If the procedure identified by this method's parameters is not found, <var>New</var> returns a <var>Null</var> object.</td></tr> | |||
<tr><th><var>[%(ProcedureInfo):]</var></th> | <tr><th><var>[%(ProcedureInfo):]</var></th> | ||
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. | <td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>ProcedureInfo</var> <var>Constructor</var>.</td></tr> | ||
<tr><th><var>In</var></th> | <tr><th><var>In</var></th> | ||
<td>string</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> | ||
<td>string</td></tr> | <td>This required, name required, parameter is a case-sensitive string that contains the exact name of the procedure whose information is being extracted.</td></tr> | ||
</table> | </table> | ||
Line 23: | Line 28: | ||
%procInf = %procInf:new | %procInf = %procInf:new | ||
</p> | </p> | ||
<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> | </ul> | ||
Wherever the procedure is located, <var>CURPRIV</var> for the group or file must be open with the X'0200' bit set. | |||
</ul> | |||
==Examples== | |||
<p class="code">... | |||
%procInfo=New(name='SSLP-REQ', in='FILE MYFILE') | |||
printText {%procInfo:name} {%procInfo:[[LastUpdateTime (ProcedureInfo function)|lastUpdateTime]]('YYYYMMDDHHMISS') | |||
... | |||
</p> | |||
The statements above produce a result like: | |||
<p class="code">SSLP-REQ 20110715094616 </p> | |||
==See also== | ==See also== | ||
{{Template:ProcedureInfo:New footer}} | {{Template:ProcedureInfo:New footer}} |
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