PutRow(Values: Array);
PutRow(Values: System.Array);
Values. Loaded row in a one-dimensional array of values.
The PutRow method loads values row into the data consumer.
For row array loading use the IDtConsumer.Put method.
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.
Executing the example requires the C:\Data_Out.txt file.
Imports Prognoz.Platform.Interop.Dt;
Imports Prognoz.Platform.Interop.Dal;
…
Sub UserProc_PutRow();
Var
TextConsumer: IDtTextConsumer;
Fields: IDtFieldDefinitions;
Field: IDtFieldDefinition;
v: System.Array;
Begin
//Array of exporting values
v := New object[3];
v[0] := "Buckwheat"; 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.ddtString;
Field.Name := "Name";
Field := Fields.Add();
Field.DataType := DbDataType.ddtInteger;
Field.Name := "Identifier";
Field := Fields.Add();
Field.DataType := DbDataType.ddtFloat;
Field.Name := "Value";
TextConsumer.Open();
TextConsumer.Clear();
TextConsumer.PutRow(v);
TextConsumer.Close();
End Sub;
After executing the example data row will be loaded to the C:\Data_Out.txt file.
See also: