$ResetN: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Reset or view M204 parameter<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Reset or view M204 parameter<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Resetn 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 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. | ||
$Resetn accepts one required and two optional arguments, and it returns a numeric value. | $Resetn accepts one required and two optional arguments, and it returns a numeric value. | ||
<ul> | <ul> | ||
<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. | <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. | ||
<li>The second argument is an optional numeric value. If specified, the parameter is reset to this value. | <li>The second argument is an optional numeric value. If specified, the parameter is reset to this value. | ||
<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. | <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. | This %variable may '''not''' be a ''[[Janus SOAP ULI]]'' class variable. | ||
<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). | <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). | ||
</ul> | </ul> | ||
$Resetn is callable. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> [%oldval =] $Resetn(parameter, newval, %rc_variable) | <p class="syntax"><section begin="syntax" /> [%oldval =] $Resetn(parameter, newval, %rc_variable) | ||
Line 25: | Line 24: | ||
</p> | </p> | ||
<p class="caption">%oldval is set to the '''parameter''' value before being reset.</p> | <p class="caption">%oldval is set to the '''parameter''' value before being reset.</p> | ||
==Error codes== | |||
<p class="code"> | <p class="code"> | ||
-1 - Invalid value for parameter | -1 - Invalid value for parameter | ||
0 - Successful completion | |||
1 - Invalid parameter name | |||
</p> | </p> | ||
<p class="caption">$Resetn return codes (set in argument 3) | <p class="caption">$Resetn return codes (set in argument 3) | ||
</p> | </p> | ||
==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: | |||
<p class="code"> %VAL = $Resetn('MSGCTL', 2) | <p class="code"> %VAL = $Resetn('MSGCTL', 2) | ||
OPEN 'MYFILE' PASSWORD 'UPDATE' | OPEN 'MYFILE' PASSWORD 'UPDATE' | ||
%VAL = $Resetn('MSGCTL', %VAL) | %VAL = $Resetn('MSGCTL', %VAL) | ||
</p> | </p> | ||
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> | 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 ERMX -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 <tt>$Resetn('ERMX',-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 UDDLPP -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 UDDLPP 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> | |||
<li>d Parameters resettable by $Resetn | <li>d Parameters resettable by $Resetn | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 74: | Line 82: | ||
</ul> | </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 $ | 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: | ||
<p class="code"> %VAL = $Resetn('UDDRFM', $X2D('12')) | <p class="code"> %VAL = $Resetn('UDDRFM', $X2D('12')) | ||
</p> | </p> | ||
See also [[$SirParm]]. | See also [[$SirParm]]. |
Revision as of 21:16, 2 February 2011
<section begin="desc" />Reset or view M204 parameter<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Resetn function.
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.
$Resetn accepts one required and two optional arguments, and it returns a numeric value.
- 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.
- The second argument is an optional numeric value. If specified, the parameter is reset to this value.
- 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.
- 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).
$Resetn is callable.
Syntax
<section begin="syntax" /> [%oldval =] $Resetn(parameter, newval, %rc_variable) <section end="syntax" />
Error 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)
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 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 $Resetn('ERMX',-2) is rejected, because -2 is outside the legal range for ERMX.
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.
The RESET UDDLPP -1 command changes UDDLPP to a value, as shown by the response to the command or as returned by $VIEW, of 65535. 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 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.
- d Parameters resettable by $Resetn
ENQRETRY 0..255: Number of record locking retries 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
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 VIEW&thinsp.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 $SirParm.
This $function is new in Version 6.0.