IDtUserConsumerEx.Module

Syntax

Module: IMetabaseObjectDescriptor;

Description

The Module property determines a Fore unit or assembly of the repository where the custom algorithm of data loading is implemented.

Comments

The Module property is used in combination with the Macro property.

Example

Executing the example requires a unit with the CUSTOM_EXPORT identifier containing the MyDtCustomConsumer class.

Add links to the Dal, Dt, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Consumer: IDtUserConsumerEx;
    Fields: IDtFieldDefinitions;
    Field: IDtFieldDefinition;
    v: Array;
    CustomCons: IDtCustomConsumer;
Begin
    MB := MetabaseClass.Active;
    
//Array of exported values
    v := New Variant[34];
    v[
00] := "Buckwheat"; v[10] := 10; v[20] := 313.12;
    v[
01] := "Milk"; v[11] := 20; v[21] := 301.53;
    v[
02] := "Sugar"; v[12] := 30; v[22] := 254.13;
    v[
03] := "Bread"; v[13] := 40; v[23] := 404.11;
    Consumer := 
New DtUserConsumerEx.Create;
    Consumer.Metabase := MB;
    Consumer.Module := MB.ItemById(
"CUSTOM_EXPORT");
    Consumer.Macro := 
"MyDtCustomConsumer";
    Fields := Consumer.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";
    Consumer.Open;
    Consumer.Clear;
    CustomCons := Consumer.CustomConsumer;
    
If CustomCons.ImplementPut Then
        Consumer.Put(v);
        Debug.WriteLine(
"Number of recorded strings: " + Consumer.WritingRowsCount.ToString);
    
Else
        Debug.WriteLine(
"Unload of two-dimensional arrays is not available");
    
End If;
    Consumer.Close;
End Sub UserProc;

On executing the example data is unloaded to the consumer using custom algorithm.

See also:

IDtUserConsumerEx