$ProcOpn: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
No edit summary
Line 4: Line 4:
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $ProcOpn function.</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $ProcOpn function.</p>


The <var>$ProcOpn</var> function is used to "open" a procedure as input to a <var class="product">User Language</var> procedure via [[$ProcGet]], [[$ProcDat]] and [[$ProcLoc]].  
The <var>$ProcOpn</var> function is used to "open" a procedure as input to a <var class="product">User Language</var> procedure via <var>[[$ProcGet]]</var>, <var>[[$ProcDat]]</var> and <var>[[$ProcLoc]]</var>.  


<var>$ProcOpn</var> accepts three arguments and returns a numeric code. As of <var class="product">[[Sirius Mods]]</var> Version 6.8, it is a [[Calling Sirius Mods $functions|callable]] $function.
<var>$ProcOpn</var> accepts three arguments and returns a numeric code, and it is a [[Calling Sirius Mods $functions|callable]] $function.


The first argument is required and identifies the <var class="product">User Language</var> procedure to be opened.  
The first argument is required and identifies the <var class="product">User Language</var> procedure to be opened.  
Line 12: Line 12:
The second argument is an optional file name. If the second argument is not provided, or is a null string, the current file is used.
The second argument is an optional file name. If the second argument is not provided, or is a null string, the current file is used.


The third argument is a string that is used by [[$ProcGet]] for dummy string substitution just as if this argument had been placed on an INCLUDE statement. Note that [[$ProcDat]] does no dummy string substitution.
The third argument is a string that is used by <var>$ProcGet</var> for dummy string substitution just as if this argument had been placed on an INCLUDE statement. Note that <var>$ProcDat</var> does no dummy string substitution.


For example, suppose procedure TIS_PITY in procedure file HOHO contains the line
For example, suppose procedure TIS_PITY in procedure file HOHO contains the line
<p class="code"> FIND1: IN ?? FIND ALL RECORDS FOR WHICH
<p class="code">FIND1: IN ?? FIND ALL RECORDS FOR WHICH
</p>
</p>


the sequence
the sequence
<p class="code"> %RESULT = $ProcOpn('TIS_PITY', 'HOHO', -
<p class="code">%result = $ProcOpn('TIS_PITY', 'HOHO', ' THESE ARE ARGUMENTS')    
            ' THESE ARE ARGUMENTS')
%line = $ProcGet
%LINE = $ProcGet
</p>
</p>


would result in %LINE being set to
would result in %line being set to
<p class="code"> FIND1: IN THESE FIND ALL RECORDS FOR WHICH
<p class="code">FIND1: IN THESE FIND ALL RECORDS FOR WHICH
</p>
</p>


==Syntax==
==Syntax==
<p class="syntax"><span class="term">%result</span> = <span class="literal">$ProcOpn</span>(<span class="term">proc_name, file_name, inc_string)
<p class="syntax"><span class="term">%result</span> = <span class="literal">$ProcOpn</span>(<span class="term">proc_name</span>, [<span class="term">file_name</span>, <span class="term">inc_string</span>)
</p>
</p>
<p>
<p>
</p>
<span class="term">%result</span> is set to indicate the success of the function.</p>
<p>%result is set to indicate the success of the function.</p>


<p class="code">  
<p class="code">-1 - Current include level not opened by $ProcOpn
-1 - Current include level not opened by $ProcOpn
0 - Procedure opened without errors
  0 - Procedure opened without errors
1 - Procedure is locked for edit or delete
  1 - Procedure is locked for edit or delete
2 - Procedure does not exist or the current user does not
  2 - Procedure does not exist or the current user does not
          have access privilege
          have access privilege
3 - Specified procedure name is invalid (null)
  3 - Specified procedure name is invalid (null)
4 - File name invalid, or no current file, or caller
  4 - File name invalid, or no current file, or caller
          does not have sufficient privilege to
          does not have sufficient privilege to
          display/include procedures
          display/include procedures
5 - The maximum number of open procedures (5)
  5 - The maximum number of open procedures (5)
          has already been reached
          has already been reached
6 - Insufficient space in ITBL to hold third
  6 - Insufficient space in ITBL to hold third
          argument; increase the size of ITBL
          argument; increase the size of ITBL
</p>
</p>
<p class="caption">$ProcOpn return codes
<p class="caption">$ProcOpn return codes
</p>
</p>


After <var>$ProcOpn</var> has successfully opened a procedure, [[$ProcGet]] and [[$ProcDat]] may be used to retrieve the procedure source lines and [[$ProcLoc]] may be used to scan them.
After <var>$ProcOpn</var> has successfully opened a procedure, <var>$ProcGet</var> and <var>$ProcDat</var> may be used to retrieve the procedure source lines and <var>$ProcLoc</var> may be used to scan them.


==Products authorizing {{PAGENAMEE}}==  
==Products authorizing {{PAGENAMEE}}==  
Line 61: Line 59:
<li>[[Janus Web Server]]
<li>[[Janus Web Server]]
</ul>
</ul>
<p>
</p>


[[Category:$Functions|$ProcOpn]]
[[Category:$Functions|$ProcOpn]]

Revision as of 18:15, 11 April 2013

Open procedure for $ProcDat, $ProcGet, $ProcLoc

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $ProcOpn function.

The $ProcOpn function is used to "open" a procedure as input to a User Language procedure via $ProcGet, $ProcDat and $ProcLoc.

$ProcOpn accepts three arguments and returns a numeric code, and it is a callable $function.

The first argument is required and identifies the User Language procedure to be opened.

The second argument is an optional file name. If the second argument is not provided, or is a null string, the current file is used.

The third argument is a string that is used by $ProcGet for dummy string substitution just as if this argument had been placed on an INCLUDE statement. Note that $ProcDat does no dummy string substitution.

For example, suppose procedure TIS_PITY in procedure file HOHO contains the line

FIND1: IN ?? FIND ALL RECORDS FOR WHICH

the sequence

%result = $ProcOpn('TIS_PITY', 'HOHO', ' THESE ARE ARGUMENTS') %line = $ProcGet

would result in %line being set to

FIND1: IN THESE FIND ALL RECORDS FOR WHICH

Syntax

%result = $ProcOpn(proc_name, [file_name, inc_string)

%result is set to indicate the success of the function.

-1 - Current include level not opened by $ProcOpn 0 - Procedure opened without errors 1 - Procedure is locked for edit or delete 2 - Procedure does not exist or the current user does not have access privilege 3 - Specified procedure name is invalid (null) 4 - File name invalid, or no current file, or caller does not have sufficient privilege to display/include procedures 5 - The maximum number of open procedures (5) has already been reached 6 - Insufficient space in ITBL to hold third argument; increase the size of ITBL

$ProcOpn return codes

After $ProcOpn has successfully opened a procedure, $ProcGet and $ProcDat may be used to retrieve the procedure source lines and $ProcLoc may be used to scan them.

Products authorizing $ProcOpn