$ResetN

From m204wiki
(Redirected from $Resetn)
Jump to: navigation, search

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