Back to Devexpress

TdxCustomMemData.DelimiterChar Property

vcl-dxmdaset-dot-tdxcustommemdata-a12da0d8.md

latest2.6 KB
Original Source

TdxCustomMemData.DelimiterChar Property

Specifies the column separator character for data exported to plain text files.

Declaration

delphi
property DelimiterChar: Char read; write;

Property Value

TypeDescription
Char

Specifies the character used to separate columns in data exported in plain text format.

|

Remarks

The DelimiterChar property value affects the following data import and export methods:

SaveToTextFile(string)Saves stored data to a plain text file.LoadFromTextFile(string)Loads data from a plain text file.SaveToStrings(TStrings)Saves data to a specified string list.LoadFromStrings(TStrings)Loads data from a specified string list.

Code Example: Copy Data Between Datasets as Plain Text

The following code example sets a semicolon as a column separator and copies data between two memory-based datasets through a plain text file.

delphi
dxMemData1.DelimiterChar := ';'; // Sets a semicolon as a column separator
  dxMemData1.SaveToTextFile(ExtractFileDir(Application.ExeName) + 'data.txt');
  dxMemData2.DisableControls; // Disables data synchronization with bound controls
  try
    dxMemData2.DelimiterChar := ';'; // Sets a semicolon as a column separator
    dxMemData2.LoadFromTextFile(ExtractFileDir(Application.ExeName) + 'data.txt');
  finally
    dxMemData2.EnableControls; // Re-enables data synchronization with bound controls
  end;
cpp
dxMemData1->DelimiterChar = ";"; // Sets a semicolon as a column separator
  dxMemData1->SaveToTextFile(ExtractFileDir(Application->ExeName) + "data.txt");
  dxMemData1->DisableControls(); // Disables data synchronization with bound controls
  try
  {
    dxMemData2->DelimiterChar = ";"; // Sets a semicolon as a column separator
    dxMemData2->LoadFromTextFile(ExtractFileDir(Application->ExeName) + "data.txt");
  }
  __finally
  {
    dxMemData2->EnableControls(); // Re-enables data synchronization with bound controls
  }

Default Value

The DelimiterChar property’s default value is #9 (Tab).

See Also

TdxCustomMemData Class

TdxCustomMemData Members

dxmdaset Unit