FastUnloadTask class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
as it is output.
as it is output.
   
   
The only way to instantiate a <var>FastUnloadTask</var> object is via the
The only way to instantiate a <var>FastUnloadTask</var> object is as the return value of the
<var>[[FastUnloadTask (Recordset function)|FastUnloadTask]]</var>
<var>[[FastUnloadTask (Recordset function)|FastUnloadTask]]</var>
method of the <var>Recordset</var> class.
function of the <var>Recordset</var> class.
   
   
The <var>FastUnloadTask</var>
The <var>FastUnloadTask</var>
class is only available to customers licensed for the <var class="product">Fast/Unload User Language Interface</var>.
class is only available to customers licensed for the <var class="product">Fast/Unload User Language Interface</var>.


The [[List of FastUnloadTask methods|"List of FastUnloadTask methods"]] lists all the methods in this class.
All methods in the <var>FastUnloadTask</var> class are shown on the [[List of FastUnloadTask methods]]. Some of them use the [[#The FastUnloadTaskState enumeration|FastUnloadTaskState enumeration]], which is shown below.
 
__TOC__
 
==The FastUnloadTaskState enumeration==
==The FastUnloadTaskState enumeration==
<var>FastUnloadTask</var> objects always have one of three states, as described
<var>FastUnloadTask</var> objects always have one of three states, as described by values of the <var>FastUnloadTaskState</var> enumeration:
by values of the <var>FastUnloadTaskState</var> enumeration:
<table class="thJustBold">
<table>
<tr><th>Started
<tr><th>Started
</th><td>The initial state of a <var>FastUnloadtask</var> object: no <var>[[GetNextRecord (FastUnloadTask function)|GetNextRecord]]</var> method calls have yet been issued.
</th><td>The initial state of a <var>FastUnloadtask</var> object: no <var>[[GetNextRecord (FastUnloadTask function)|GetNextRecord]]</var> method calls have yet been issued.</td></tr>
</td></tr>
 
<tr><th>HaveRecord
<tr><th>HaveRecord
</th><td><var>GetNextRecord</var> has been called, and the call did, indeed, retrieve another record from <var class="product">[[Fast/Unload]]</var>.
</th><td><var>GetNextRecord</var> has been called, and the call did, indeed, retrieve another record from <var class="product">Fast/Unload</var>.</td></tr>
</td></tr>
<tr><th>Done
</th><td><var>GetNextRecord</var> has been called, and the call discovered that there were no more records to retrieve, that is, <var class="product">Fast/Unload</var> had terminated.
</td></tr></table>


'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|"Common enumeration methods"]].
<tr><th>Done</th>
<td><var>GetNextRecord</var> has been called, and the call discovered that there were no more records to retrieve, that is, <var class="product">Fast/Unload</var> had terminated.</td></tr>
</table>
 
<p class="note">'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|Common enumeration methods]]. </p>


==FastUnloadTask example==
==FastUnloadTask example==
The following code prints
The following code prints the contents of set of fields in a fixed format, using <var class="product">Fast/Unload</var> to extract the fields.
the contents of set of fields in a fixed format, using <var class="product">[[Fast/Unload]]</var> to extract
the fields.
There is probably little benefit to using <var class="product">[[Fast/Unload]]</var> here instead of native <var class="product">Model 204</var>
There is probably little benefit to using <var class="product">[[Fast/Unload]]</var> here instead of native <var class="product">Model 204</var>
field access facilities, but the example does show some of the
field access facilities, but the example does show some of the <var>FastUnloadtask</var> methods:
<var>FastUnloadtask</var> methods:
<p class="code">b
<p class="code">b
%rs      is object recordSet in file sirFiled
%rs      is object recordSet in file sirFiled
Line 62: Line 60:
end
end
</p>
</p>
==See also==
The [[List of FastUnloadTask methods|"List of FastUnloadTask methods"]] shows all the class methods.


[[Category:System classes]]
[[Category:System classes]]

Latest revision as of 19:43, 23 July 2014

The FastUnloadTask class is used for retrieving data from a Fast/Unload task as it is output.

The only way to instantiate a FastUnloadTask object is as the return value of the FastUnloadTask function of the Recordset class.

The FastUnloadTask class is only available to customers licensed for the Fast/Unload User Language Interface.

All methods in the FastUnloadTask class are shown on the List of FastUnloadTask methods. Some of them use the FastUnloadTaskState enumeration, which is shown below.

The FastUnloadTaskState enumeration

FastUnloadTask objects always have one of three states, as described by values of the FastUnloadTaskState enumeration:

Started The initial state of a FastUnloadtask object: no GetNextRecord method calls have yet been issued.
HaveRecord GetNextRecord has been called, and the call did, indeed, retrieve another record from Fast/Unload.
Done GetNextRecord has been called, and the call discovered that there were no more records to retrieve, that is, Fast/Unload had terminated.

Note: As with all enumerations, the ToString method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see Common enumeration methods.

FastUnloadTask example

The following code prints the contents of set of fields in a fixed format, using Fast/Unload to extract the fields. There is probably little benefit to using Fast/Unload here instead of native Model 204 field access facilities, but the example does show some of the FastUnloadtask methods:

b %rs is object recordSet in file sirFiled %ft is object fastUnloadTask %listi is object stringList find records to %rs end find %listi = new text to %listi FOR EACH RECORD PUT FILE AS STRING(8) PUT RECTYPE AS STRING(8) PUT DATE AS STRING(12) OUTPUT END FOR end text %ft = %rs:fastUnloadTask(%listi, parameters='NEBUFF=2', - reportToStringlist=true) repeat while %ft:getNextRecord ne done print %ft:currentRecord end repeat %ft:report:print print %ft:returnCode end

See also

The "List of FastUnloadTask methods" shows all the class methods.