FastUnloadTask class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 7: Line 7:
   
   
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>.
and it is only available in <var class="product">Sirius Mods</var> version 6.7 and later.
   
   
==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:

Revision as of 15:13, 17 May 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 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 (FastUnloadTask function) 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.

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