FastUnloadTask class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 16: Line 16:
<table>
<table>
<tr><th>Started
<tr><th>Started
</th><td>The initial state of a <var>FastUnloadtask</var> object: no <var>[[GetNextRecord (FastUnloadTask function)]]</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
Line 22: Line 22:
</td></tr>
</td></tr>
<tr><th>Done
<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.
</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>
</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"]].
==FastUnloadTask example==
==FastUnloadTask example==
The following code prints
The following code prints

Revision as of 21:02, 16 August 2011

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 via the FastUnloadTask method of the Recordset class.

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

The "List of FastUnloadTask methods" lists all the methods in this class.

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