$ProcDat: Difference between revisions
m (1 revision) |
m (1 revision) |
||
Line 58: | Line 58: | ||
<p class="code"> -1 - Current include level not opened by $ProcOpn | <p class="code"> -1 - Current include level not opened by $ProcOpn | ||
-3 - No room to create $list items | -3 - No room to create $list items | ||
(if LISTFC $SirParm parameter not set) | (if LISTFC <var>$SirParm</var> parameter not set) | ||
-5 - Required parameter missing | -5 - Required parameter missing | ||
-6 - Invalid $list identifier | -6 - Invalid $list identifier |
Revision as of 01:28, 19 October 2012
Add lines from procedure to $list
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ProcDat function is the AppendOpenProcedure (Stringlist function).
The $ProcDat function accepts three arguments, and returns a numeric code.
The first argument identifies the $list to which lines from the currently open procedure will be added as $list items. This is a required argument.
The second argument is an optional number of lines to be read. If the second argument is not provided, reading continues from the input procedure to the end of the procedure.
The third argument specifies a sequence number increment for 8 byte sequence numbers to be placed in front of each line in the output $list. This sequence number indicates both the starting sequence number and the sequence number increment. If this parameter is not provided, no sequence numbers are placed in front of the input lines.
Syntax
<section begin="syntax" /> %RESULT = $ProcDat ( list_identifier, num_lines, seq_inc ) <section end="syntax" />
The third argument to $ProcDat is intended for use in conjunction with the $ListUpd and $ListCmp functions.
Examples
If procedure 'SUTPENS_HUNDRED' in file 'JACKSON' contains:
B FOR %I FROM 1 TO 10 PRINT %I END FOR END
This program:
B %LIST = $ListNew %RESULT = $ProcOpn('SUTPENS_HUNDRED', 'JACKSON') %RESULT = $ProcDat(%LIST, ,5000) FOR %I FROM 1 TO $ListCnt(%LIST) PRINT $ListInf(%LIST, %I) END FOR END
Prints the following:
00005000B 00010000FOR %I FROM 1 TO 10 00015000 PRINT %I 00020000END FOR 00025000END
Error codes
-1 - Current include level not opened by $ProcOpn -3 - No room to create $list items (if LISTFC $SirParm parameter not set) -5 - Required parameter missing -6 - Invalid $list identifier