$ListUpd

From m204wiki
Revision as of 19:09, 10 February 2011 by Alan (talk | contribs)
Jump to navigation Jump to search

<section begin="desc" />Produce $list from input $list using $list of updates<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListUpd function is the Update (Stringlist function).

This function uses a first $list to update a second $list, producing a third $list containing data from the second $list as modified by the first $list.

The $ListUpd function accepts three arguments and returns a numeric result. It is a callable $function (see Calling Sirius Mods $functions).

The first argument is the identifier of a $list containing data with 8 byte sequence numbers. This is a required argument.

The second argument is the identifier of a $list containing update control statements and insertion or replacement lines. This is a required argument.

The third argument is the identifier of the output $list. This is a required argument.

Syntax

<section begin="syntax" /> [%RESULT =] $ListUpd(list_id1, list_id2, list_id3) <section end="syntax" />

$ListUpd Function

%RESULT is set either to the number of items in the output $list, or to a negative error code if an error has occurred.

The output $list produced by $ListUpd contains sequence numbers just as input $list 1. This makes it possible to use the output $list as input to another $ListUpd call. In this way it is possible to apply multiple updates to a single $list.

The first input $list to $ListUpd can be most easily created with the $ProcDat function using the fifth parameter to indicate a sequence number. The second input $list to $ListUpd can be most easily created with the $ListCmp function.

-3 - No room to create $list items (if LISTFC $SirParm parameter not set) -5 - Required argument not specified -6 - $List identifier invalid -8 - Input $list 1 has invalid format

$ListUpd Error Codes

The update $list (input $list 2) contains update control statements and insertion or replacement lines. The update $list must begin with an update control statement. All update control statements begin with the './ ' characters followed by a single character indicating the function and possible sequence numbers indicating the lines in input $list to which the updates apply. Any items in input $list 1 not updated by the update $list are simply copied into the output $list. The update control statements are:

./ * comment This is a comment control statement and is ignored. This statement must be followed by another update control statement or it must be the last item in the update $list.
./ D seq1 { seq2 } { $ } This is a deletion control statement indicating a range of input lines to be deleted. seq1 and seq2 indicate the range of sequence numbers in the input $list that are to be deleted. If seq2 is not specified, it is assumed to equal seq1, that is only the single line indicated by seq1 will be deleted. This statement must be followed by another update control statement or it must be the last item in the update $list.
./ I seq1 { $ seq2 { seq3 } } This is an insertion control statement and is followed by lines that are to be inserted in the output $list. seq1 indicates the sequence number in the input $list after which the lines are to be inserted. seq2 is the sequence number to be assigned to the first inserted line and seq3 indicates the increment to be added to the current sequence number for subsequent inserted lines. The lines to be inserted are terminated by another update control statement.
./ R seq1 {seq2} { $ seq3 { seq4 } } This is a replacement control statement and is followed by lines that are to replace lines from the input $list in the output $list. seq1 and seq2 indicate the range of sequence numbers in the input $list that are to be replaced. If seq2 is not specified, it is assumed to equal seq1, that is, only the single line indicated by seq1 will be replaced. seq3 is the sequence number to be assigned to the first replacement line and seq4 indicates the increment to be added to the current sequence number for subsequent replacement lines. The replacement lines are terminated by another update control statement.
./ S seq1 { seq2 } { $ } This is an resequence control statement and must be the first non-comment control statement in the update $list. This statement indicates that the output $list, after all subsequent updates have been applied, is to be given sequence numbers starting at seq1 and incremented by seq2.

Products authorizing $ListUpd