AppendOpenProcedure (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(27 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Template:Stringlist:AppendOpenProcedure subtitle}}
{{Template:Stringlist:AppendOpenProcedure subtitle}}


This callable method adds lines to the end of a Stringlist from a procedure opened with $procopn (described in the ''Sirius Functions Reference Manual'').
This [[Notation conventions for methods#Callable functions|callable]] method adds lines to the end of a <var>Stringlist</var> from a procedure opened with <var>[[$ProcOpn]]</var>.
 
AppendOpenProcedure is a member of the [[Stringlist class]].


==Syntax==
==Syntax==
Line 10: Line 8:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%rc</th>
<tr><th>%rc</th>
<td>A numeric variable that is set to zero if the function is a success.</td></tr>
<td>An, optional, numeric variable that is set to zero if the function is a success.</td></tr>
<tr><th>sl</th>
<tr><th>sl</th>
<td>A Stringlist object.</td></tr>
<td>A <var>Stringlist</var> object.</td></tr>
<tr><th>numLines</th>
<tr><th>numLines</th>
<td>The number of lines to be read. If this optional argument is not provided, reading continues from the input procedure to the end of that procedure.</td></tr>
<td>The number of lines to be read. If this optional argument is not provided, reading commences from the start of the input procedure, if no lines have been read from it yet; or continues from after the last line read, if data has already been read from the procedure; and continues to the end of that procedure.</td></tr>
<tr><th>seqIncrement</th>
<tr><th>seqIncrement</th>
<td>A sequence number increment for 8-byte sequence numbers to be placed in front of each line in the output Stringlist. 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.</td></tr>
<td>A sequence number increment for 8-byte sequence numbers to be placed in front of each line in the output <var>Stringlist</var>. 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 output lines.</td></tr>
</table>
</table>


==Usage notes==
==Usage notes==
<ul><li>All errors in AppendOpenProcedure result in request cancellation.<li>The '''seqIncrement''' argument to AppendOpenProcedure is intended for use in conjunction with the Update (:hdref reftxt=Update refid=slupd.) and Compare (:hdref reftxt=Compare refid=slcomp.) methods.</ul>
<ul><li>All errors in <var>AppendOpenProcedure</var> result in request cancellation.
<li>The <var class="term">seqIncrement</var> argument to <var>AppendOpenProcedure</var> is intended for use in conjunction with the <var>[[Update (Stringlist function)|Update]]</var> and <var>[[Compare (Stringlist function)|Compare]]</var> methods.</ul>


==Examples==
==Examples==
 
In the following example of the <var>AppendOpenProcedure</var> method, procedure <code>SUTPENS_HUNDRED</code> in file <code>JACKSON</code> contains this request:
In the following example of the AppendOpenProcedure method, procedure SUTPENS_HUNDRED in file JACKSON contains this request:
<p class="code">begin
 
for %i from 1 to 10
<pre>
    print %i
b
end for
for %i from 1 to 10
print %i
end for
end
end
</pre>
</p>


The program example follows:
The program example follows:


<pre>
<p class="code">begin
b
%list is object stringlist
 
%rc is float
%list is object stringList
%rc is float
%list = new
 
%list = new
%rc = $procopn('SUTPENS_HUNDRED', 'JACKSON')
 
%list:appendOpenProcedure(,5000)
%rc = $procopn('SUTPENS_HUNDRED', 'JACKSON')
%list:appendOpenProcedure(,5000)
%list:print
 
%listrint
 
end
end
</pre>
</p>


The program result is a print of these lines:
The program result is a print of these lines:


<pre>
<p class="output">00005000begin
00005000b
00010000  for %i from 1 to 10
00010000for %i from 1 to 10
00015000     print %i
00015000 print %i
00020000  end for
00020000end for
00025000end
00025000end
</pre>
</p>
 


[[Category:Stringlist methods|AppendOpenProcedure function]]
==See also==
{{Template:Stringlist:AppendOpenProcedure footer}}

Latest revision as of 19:17, 11 June 2014

Add lines from procedure to Stringlist (Stringlist class)


This callable method adds lines to the end of a Stringlist from a procedure opened with $ProcOpn.

Syntax

[%rc =] sl:AppendOpenProcedure[( [numLines], [seqIncrement])]

Syntax terms

%rc An, optional, numeric variable that is set to zero if the function is a success.
sl A Stringlist object.
numLines The number of lines to be read. If this optional argument is not provided, reading commences from the start of the input procedure, if no lines have been read from it yet; or continues from after the last line read, if data has already been read from the procedure; and continues to the end of that procedure.
seqIncrement A sequence number increment for 8-byte sequence numbers to be placed in front of each line in the output Stringlist. 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 output lines.

Usage notes

  • All errors in AppendOpenProcedure result in request cancellation.
  • The seqIncrement argument to AppendOpenProcedure is intended for use in conjunction with the Update and Compare methods.

Examples

In the following example of the AppendOpenProcedure method, procedure SUTPENS_HUNDRED in file JACKSON contains this request:

begin for %i from 1 to 10 print %i end for end

The program example follows:

begin %list is object stringlist %rc is float %list = new %rc = $procopn('SUTPENS_HUNDRED', 'JACKSON') %list:appendOpenProcedure(,5000) %list:print end

The program result is a print of these lines:

00005000begin 00010000 for %i from 1 to 10 00015000 print %i 00020000 end for 00025000end

See also