FastUnloadTask class

From m204wiki
Jump to navigation Jump to search

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.