$ResetN: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
(55 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Resetn}}
{{DISPLAYTITLE:$ResetN}}
<span class="pageSubtitle"><section begin="desc" />Reset or view M204 parameter<section end="desc" /></span>
<span class="pageSubtitle">Reset or view M204 parameter</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Resetn function is [[to be entered]].</p>
<p class="warn"><b>Note:</b> Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the <var>$ResetN</var> function.</p>


This function retrieves the current value of a ''Model 204'' parameter, and it can also change the value of that parameter. Not all parameters are resettable by $Resetn: the supported subset includes only parameters considered useful to change as well as safe to change during evaluation of a User Language request.  
This [[Calling Sirius Mods $functions|callable]] function retrieves the current value of a <var class="product">Model 204</var> parameter, and it can also change the value of that parameter. Not all parameters are resettable by $ResetN: the supported subset includes only parameters considered useful to change as well as safe to change during evaluation of a <var class="product">SOUL</var> request.  


$Resetn accepts one required and two optional arguments, and it returns a numeric value.
<var>$ResetN</var> accepts one required and two optional arguments, and it returns a numeric value.  
<ul>
 
==Syntax==
<p class="syntax">[%oldval =] $ResetN(parameter, newval, %rc_variable)
</p>
 
===Syntax terms===
<table class="syntaxTable">
<tr><th>%oldval</th>
<td>The returned value is the current value of <var class="term">parameter</var> (before <var>$ResetN</var> changes it). If the <var class="term">parameter</var> is not the name of a parameter supported by <var>$ResetN</var>, the returned value is 0 (if <var class="term">%rc_variable</var> is supplied; otherwise this and all errors cause request cancellation).</td></tr>


<li>The first argument is a string which is the name of the parameter to retrieve (and optionally reset). See the list in :liref refid=rsetprm. for the parameters allowed.
<tr><th>parameter</th>
<li>The second argument is an optional numeric value. If specified, the parameter is reset to this value.
<td>A string that is the name of the parameter to retrieve (and optionally reset). See the list of allowed parameters in [[#Parameters resettable by $ResetN|Parameters resettable by $ResetN]]. </td></tr>
<li>The third argument is an optional %variable which is the target for the $Resetn return code. If specified, this %variable is set to one of the return codes shown in the table below. If this argument is omitted and a condition occurs that is associated with a non-zero value in the return code table, the request is cancelled.


This %variable may '''not''' be a ''[[Janus SOAP ULI]]'' class variable.
<tr><th>newval</th>
<li>The returned value is the current value of the parameter (before $Resetn changes it). If the first argument is not the name of a parameter supported by $RESETN, the returned value is 0 (if argument 3 is supplied; otherwise this and all errors cause request cancellation).
<td>An optional numeric value. If specified, the parameter is reset to this value. </td></tr>
</ul>


<tr><th>%rc_variable</th>
<td>An optional %variable that is the target for the <var>$ResetN</var> return code. If specified, this %variable is set to one of the return codes shown [[#Return codes|below]]. If this argument is omitted and a condition occurs that is associated with a non-zero return code value, the request is cancelled.
<p>
This %variable may '''not''' be a <var class="product">SOUL</var> [[Classes_and_Objects#Variable_declarations|class variable]]. </p></td></tr>
</table>


$Resetn is callable .
==Return codes==
==Syntax==
<p class="code">-1 &mdash; Invalid value for parameter
<p class="syntax"><section begin="syntax" /> [%oldval =] $Resetn(parameter, newval, %rc_variable)
0 &mdash; Successful completion
<section end="syntax" /></p>
1 &mdash; Invalid parameter name
<p class="caption">$Resetn Function
</p>
</p>
<p class="caption">%oldval is set to the '''parameter''' value before being reset.</p>
 
<p class="code">  
==Examples==
-1 - Invalid value for parameter
For example, the following fragment will to prevent the <code>M204.0620 FILE OPENED</code> and <code>M204.1203 FILE WAS LAST UPDATED</code> messages from going to the user's terminal:
0 - Successful completion
 
1 - Invalid parameter name
<p class="code">%VAL = $ResetN('MSGCTL', 2)
</p>
OPEN 'MYFILE' PASSWORD 'UPDATE'
<p class="caption">$Resetn return codes (set in argument 3)
%VAL = $ResetN('MSGCTL', %VAL)
</p>
</p>


==Parameters resettable by $ResetN==
In the following list of parameters, the minimum and maximum value is shown. Note that these values may be more strict than the corresponding minimums and maximums allowed by the <var class="product">Model&nbsp;204</var> <var>[[RESET command|RESET]]</var> command. For example, the <code>RESET ERMX -2</code> command changes <var>[[ERMX parameter|ERMX]]</var> to a value, as shown by the response to the command, of 65534. However, the value of -2 is not "meaningful" for <var>ERMX</var>. To avoid this, an attempt to invoke <code>$ResetN('ERMX',-2)</code> is rejected, because -2 is outside the legal range for <var>ERMX</var>.
<p class="note">'''Note: ''' This situation is even more pointed for <var>UDDLPP</var>, which is currently not supported for <var>$ResetN
</var> because there is little reason to change it from within a <var class="product">SOUL</var> request.</p>
The <code>RESET UDDLPP -1</code> command changes <var>[[UDDLPP parameter|UDDLPP]]</var> to a value of 65535, as shown by the response to the command or as returned by <var>$VIEW</var>. However, the <code>RESET UDDLPP 65535</code> command issues an error message and changes <var>UDDLPP</var> to the value of 32767, which is very different from the meaning of -1 for <var>UDDLPP</var>.
The valid parameter names which may be supplied as the <var class="term">parameter</var> argument to <var>$ResetN</var> are shown in the following list, along with the minimum and maximum values and a terse description.
<table>
<tr><th><var>[[ENQRETRY parameter|ENQRETRY]]</var></th>
<td>0..255: Record-locking retry count</td></tr>
<tr><th><var>[[ENQTIME parameter|ENQTIME]]</var></th>
<td>1..60000: Record-locking retry wait time, milliseconds (new in version 7.8, or in 7.7 with zap 77Z299)</td></tr>


For example, the following fragment will to prevent the M204.0620 FILE OPENED and M204.1203 FILE WAS LAST UPDATED messages from going to the user's terminal:
<tr><th><var>[[ERCNT parameter|ERCNT]]</var></th>
<p class="code"> %VAL = $Resetn('MSGCTL', 2)
<td>0..65,535: Error count (provided by the <var class="product">Sirius Mods</var>). (Note that the you can also increment or clear this using <var>[[$ErrSet]]</var>.)</td></tr>
OPEN 'MYFILE' PASSWORD 'UPDATE'
%VAL = $Resetn('MSGCTL', %VAL)
</p>
In the following list of parameters, the minimum and maximum value is shown. Note that these values may be more strict than the corresponding minimums and maximums allowed by the ''Model 204'' RESET command. For example, the <tt>RESET&thinsp.ERMX&thinsp.-2</tt> command changes ERRMX to a value, as shown by the response to the command, of 65534. However, the value of -2 is not "meaningful" for ERMX. To avoid this, an attempt to invoke
<li>.$Resetn('ERMX',&thinsp.-2)</tt> is rejected, because -2 is outside the legal range for ERMX.<blockquote> This situation is even more pointed for UDDLPP, which is currently not supported for $Resetn because there's little reason to change it from within a User Language request.</blockquote> The <tt>RESET&thinsp.UDDLPP&thinsp.-1</tt> command changes UDDLPP to a value, as shown by the response to the command or as returned by $VIEW, of 65535. However, the <tt>RESET&thinsp.UDDLPP&thinsp.65535</tt> command issues an error message and changes UDDLPP to the value of 32767, which is very different from the meaning of -1 for UDDLPP.


The valid parameter names which may be supplied as the first argument to $Resetn are shown in the following list, along with the minimum and maximum values and a terse description. For more information about these parameters, see the ''"Model 204 Command Reference Manual"'', except, where indicated, a parameter is not a base ''Model 204'' parameter but is one that is delivered with the ''[[Sirius Mods]]''.<ul>
<tr><th><var>[[ERMX parameter|ERMX]]</var></th>
<li>d Parameters resettable by $Resetn
<table class="syntaxTable">
<tr><th>ENQRETRY</th>
<td>0..255: Number of record locking retries</td></tr>
<tr><th>ERCNT</th>
<td>0..65,535: Error count (provided by the ''[[Sirius Mods]]''). (Note that the you can also increment or clear this using [[$ErrSet]].)</td></tr>
<tr><th>ERMX</th>
<td>-1..65,534: Maximum number of errors</td></tr>
<td>-1..65,534: Maximum number of errors</td></tr>
<tr><th>FSOUTPUT</th>
 
<tr><th><var>[[FSOUTPUT parameter|FSOUTPUT]]</var></th>
<td>0..2: Full screen color and highlighting</td></tr>
<td>0..2: Full screen color and highlighting</td></tr>
<tr><th>HDRCTL</th>
 
<tr><th><var>[[HDRCTL parameter|HDRCTL]]</var></th>
<td>0..255: Header control</td></tr>
<td>0..255: Header control</td></tr>
<tr><th>MBSCAN</th>
 
<tr><th><var>[[MBSCAN parameter|MBSCAN]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum table B to records scan</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum table B to records scan</td></tr>
<tr><th>MCNCT</th>
 
<tr><th><var>[[MCNCT parameter|MCNCT]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum connect time</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum connect time</td></tr>
<tr><th>MCPU</th>
 
<tr><th><var>[[MCPU parameter|MCPU]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum CPU time</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum CPU time</td></tr>
<tr><th>MDKRD</th>
 
<tr><th><var>[[MDKRD parameter|MDKRD]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum disk reads</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum disk reads</td></tr>
<tr><th>MDKWR</th>
 
<tr><th><var>[[MDKWR parameter|MDKWR]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum disk writes</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum disk writes</td></tr>
<tr><th>MOUT</th>
 
<tr><th><var>[[MOUT parameter|MOUT]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum output lines</td></tr>
<td>-2,147,483,647..2,147,483,647: Maximum output lines</td></tr>
<tr><th>MSGCTL</th>
 
<tr><th><var>[[MSGCTL parameter|MSGCTL]]</var></th>
<td>0..255: Message printing options</td></tr>
<td>0..255: Message printing options</td></tr>
<tr><th>MUDD</th>
 
<tr><th><var>[[MUDD parameter|MUDD]]</var></th>
<td>-2,147,483,647..2,147,483,647: Maximum USE dataset lines
<td>-2,147,483,647..2,147,483,647: Maximum USE dataset lines
</td></tr></table>
</td></tr></table>
</ul>


As mentioned, the second argument to $Resetn is the '''numeric''' value to which the parameter should be set. Some of the parameters supported by $Resetn are treated as "hexadecimal" parameters by the ''Model 204'' RESET command. For example, the <tt>VIEW&thinsp.HDRCTL</tt> command displays a result such as "X'01'". It so happens that this is a moot point with any of these "hex" parameters currently supported by $RESETN, because the maximum value they may have is 7, which is the same in base 10 and base 16. However, if $Resetn is extended to support, for example, UDDRFM, you might wish to supply an argument to $Resetn expressed in hex. This could be easily accomplished using the $X2D function. Again, assuming $Resetn were extended to support UDDRFM, you could set the USE dataset record format to variable length records with ASA carriage control with the following statement:
Some of the parameters supported by <var>$ResetN</var> are treated as "hexadecimal" parameters by the <var class="product">Model&nbsp;204</var> <var>RESET</var> command. For example, the <code>VIEW HDRCTL</code> command displays a result such as <code>X'01'</code>. It so happens that this is a moot point with any of these "hex" parameters currently supported by <var>$ResetN</var>, because the maximum value they may have is 7, which is the same in base 10 and base 16.  
<p class="code"> %VAL = $Resetn('UDDRFM', $X2D('12'))
<p>
However, if <var>$ResetN</var> is extended to support, for example, <var>UDDRFM</var>, you might wish to supply an argument to <var>$ResetN</var> expressed in hex. This could be easily accomplished using the <var>$X2D</var> function. Again, assuming <var>$ResetN</var> were extended to support <var>UDDRFM</var>, you could set the USE dataset record format to variable length records with ASA carriage control with the following statement:</p>
 
<p class="code">%VAL = $ResetN('UDDRFM', $X2D('12'))
</p>
</p>


==See also==
<ul>
<li><var>[[$SirParm]]</var>
</ul>


See also [[$SirParm]].
==Products authorizing {{PAGENAMEE}}==
 
This $function is new in Version 6.0.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius Functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $Resetn
</p>




[[Category:$Functions|$Resetn]]
[[Category:$Functions|$ResetN]]

Latest revision as of 00:16, 11 November 2019

Reset or view M204 parameter

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $ResetN function.

This callable function retrieves the current value of a Model 204 parameter, and it can also change the value of that parameter. Not all parameters are resettable by $ResetN: the supported subset includes only parameters considered useful to change as well as safe to change during evaluation of a SOUL request.

$ResetN accepts one required and two optional arguments, and it returns a numeric value.

Syntax

[%oldval =] $ResetN(parameter, newval, %rc_variable)

Syntax terms

%oldval The returned value is the current value of parameter (before $ResetN changes it). If the parameter is not the name of a parameter supported by $ResetN, the returned value is 0 (if %rc_variable is supplied; otherwise this and all errors cause request cancellation).
parameter A string that is the name of the parameter to retrieve (and optionally reset). See the list of allowed parameters in Parameters resettable by $ResetN.
newval An optional numeric value. If specified, the parameter is reset to this value.
%rc_variable An optional %variable that is the target for the $ResetN return code. If specified, this %variable is set to one of the return codes shown below. If this argument is omitted and a condition occurs that is associated with a non-zero return code value, the request is cancelled.

This %variable may not be a SOUL class variable.

Return codes

-1 — Invalid value for parameter 0 — Successful completion 1 — Invalid parameter name

Examples

For example, the following fragment will to prevent the M204.0620 FILE OPENED and M204.1203 FILE WAS LAST UPDATED messages from going to the user's terminal:

%VAL = $ResetN('MSGCTL', 2) OPEN 'MYFILE' PASSWORD 'UPDATE' %VAL = $ResetN('MSGCTL', %VAL)

Parameters resettable by $ResetN

In the following list of parameters, the minimum and maximum value is shown. Note that these values may be more strict than the corresponding minimums and maximums allowed by the Model 204 RESET command. For example, the RESET ERMX -2 command changes ERMX to a value, as shown by the response to the command, of 65534. However, the value of -2 is not "meaningful" for ERMX. To avoid this, an attempt to invoke $ResetN('ERMX',-2) is rejected, because -2 is outside the legal range for ERMX.

Note: This situation is even more pointed for UDDLPP, which is currently not supported for $ResetN because there is little reason to change it from within a SOUL request.

The RESET UDDLPP -1 command changes UDDLPP to a value of 65535, as shown by the response to the command or as returned by $VIEW. However, the RESET UDDLPP 65535 command issues an error message and changes UDDLPP to the value of 32767, which is very different from the meaning of -1 for UDDLPP.

The valid parameter names which may be supplied as the parameter argument to $ResetN are shown in the following list, along with the minimum and maximum values and a terse description.

ENQRETRY 0..255: Record-locking retry count
ENQTIME 1..60000: Record-locking retry wait time, milliseconds (new in version 7.8, or in 7.7 with zap 77Z299)
ERCNT 0..65,535: Error count (provided by the Sirius Mods). (Note that the you can also increment or clear this using $ErrSet.)
ERMX -1..65,534: Maximum number of errors
FSOUTPUT 0..2: Full screen color and highlighting
HDRCTL 0..255: Header control
MBSCAN -2,147,483,647..2,147,483,647: Maximum table B to records scan
MCNCT -2,147,483,647..2,147,483,647: Maximum connect time
MCPU -2,147,483,647..2,147,483,647: Maximum CPU time
MDKRD -2,147,483,647..2,147,483,647: Maximum disk reads
MDKWR -2,147,483,647..2,147,483,647: Maximum disk writes
MOUT -2,147,483,647..2,147,483,647: Maximum output lines
MSGCTL 0..255: Message printing options
MUDD -2,147,483,647..2,147,483,647: Maximum USE dataset lines

Some of the parameters supported by $ResetN are treated as "hexadecimal" parameters by the Model 204 RESET command. For example, the VIEW HDRCTL command displays a result such as X'01'. It so happens that this is a moot point with any of these "hex" parameters currently supported by $ResetN, because the maximum value they may have is 7, which is the same in base 10 and base 16.

However, if $ResetN is extended to support, for example, UDDRFM, you might wish to supply an argument to $ResetN expressed in hex. This could be easily accomplished using the $X2D function. Again, assuming $ResetN were extended to support UDDRFM, you could set the USE dataset record format to variable length records with ASA carriage control with the following statement:

%VAL = $ResetN('UDDRFM', $X2D('12'))

See also

Products authorizing $ResetN