$ResetN: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
(No difference)

Revision as of 22:05, 16 June 2012

Reset or view M204 parameter

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" />

$Resetn Function

%oldval is set to the parameter value before being reset.

Error codes

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

$Resetn return codes (set in argument 3)

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.

Products authorizing $Resetn