IDtConsumer.PutRow

Syntax

PutRow(Values: Array);

Parameters

Values. Loaded row in a one-dimensional array of values.

Description

The PutRow method loads values row into the data consumer.

Comments

For row array loading use the IDtConsumer.Put method.

Example

Executing the example requires the C:\Data_Out.txt file. Add links to the Dt, Dal system assemblies.

Sub UserProc_PutRow;
Var
    TextConsumer: IDtTextConsumer;
    Fields: IDtFieldDefinitions;
    Field: IDtFieldDefinition;
    v: Array;
Begin
//Array of exported values
    v := New Variant[3];
    v[0] := "Rice"; v[1] := 10; v[2] := 313.12;
    TextConsumer := New DtTextConsumer.Create;
    TextConsumer.File := "C:\Data_Out.txt";
    TextConsumer.WriteHeader := True;
    Fields := TextConsumer.Fields;
    Field := Fields.Add;
    Field.DataType := DbDataType.String;
    Field.Name := "Name";
    Field := Fields.Add;
    Field.DataType := DbDataType.Integer;
    Field.Name := "Identifier";
    Field := Fields.Add;
    Field.DataType := DbDataType.Float;
    Field.Name := "Value";
    TextConsumer.Open;
    TextConsumer.Clear;
    TextConsumer.PutRow(v);
    TextConsumer.Close;
End Sub UserProc_PutRow;

After executing the example data row will be loaded to the C:\Data_Out.txt file.

See also:

IDtConsumer