IDtConsumer.PutRow

Syntax

PutRow(Values: Array);

Parameters

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

Description

The PutRow method loads values row to the data consumer.

Comments

To load the rows array, use the IDtConsumer.Put method.

Example

Executing the example requires the C:\Data_Out.txt file.

Add links to the Dt and 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 the data row is loaded to the specified file.

See also:

IDtConsumer