FastUnloadTask class: Difference between revisions
No edit summary |
|||
Line 15: | Line 15: | ||
==The FastUnloadTaskState enumeration== | ==The FastUnloadTaskState enumeration== | ||
<var>FastUnloadTask</var> objects always have one of three states, as described by values of the <var>FastUnloadTaskState</var> enumeration: | <var>FastUnloadTask</var> objects always have one of three states, as described by values of the <var>FastUnloadTaskState</var> enumeration: | ||
<table> | <table class="thJustBold"> | ||
<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.</td></tr> | </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> |
Revision as of 19:42, 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.