listview ExportToTXT method
Return to Introduction  Previous page  Next page
Applies to
acListView and acDBListView components.  

Declaration
procedure ExportToTXT(const FileName: String; ExportColumnCaptions: Boolean = True);  

Description
The ExportToTXT procedure can export all items and columns (if ExportColumCaption parameter is True) to the text file specified in FileName parameter.  
 
Each row separated by CRLF (#13#10) characters, every column separated by Tab (#9) character.  

Example
procedure TMainForm.AsTXT1Click(Sender: TObject);  
const  
  EXT_TYPE: Array[0..1of String = ('TXT''HTML');  
  ExportConnectionsStr = 'Export Connections to %s file';  
begin  
  with SaveDialog1, (Sender as TComponent) do  
   begin  
    DefaultExt := EXT_TYPE[Tag];  
    Title := Format(ExportConnectionsStr, [UpperCase(DefaultExt)]);  
    FilterIndex := Tag + 1;  
    if Execute then  
     if Tag = 0 then  
       acListView1.ExportToTXT(FileName)  
     else  
       acListView1.ExportToHTML(FileName);  
   end;  
end;  

See also
ImportFromTXT and ExportToHTML methods.