Save the CSV file via Tstringlist, just loop. Each row in the Add table is recorded and saved

Source: Internet
Author: User

Dlgsave: = Tsavedialog.Create(Nil); Dlgsave.filter:='csv file |*. CSV'; Dlgsave.defaultext:='*. CSV'; Dlgsave.filename:='service. CSV'; ifDlgsave.execute Then  begin    ifFileExists (Dlgsave.filename) Then      Try        ifMessagedlg ('the file already exists, do you want to overwrite it? ', Mtinformation, [Mbyes, Mbno],0) =Idyes ThenDeleteFile (PChar (dlgsave.filename))Else        beginExit; End; exceptExit; End; FileName:=Dlgsave.filename;  Savecurpage (filename); End; SList:= Tstringlist.Create; Slist.add ('id,***,***,***,***,***,***,***');  forI: =0  toGrdvehiclelist.rowcount-1  Do      beginSlist.add (grdvehiclelist.cell[0, I]. Asstring+','+Grdvehiclelist.cell[comno_index,i]. Asstring+','+Grdvehiclelist.cell[vno_index, I]. Asstring+','+Grdvehiclelist.cell[regcolor_index, I]. Asstring+','+Grdvehiclelist.cell[groupid_index, I]. Asstring+','+Grdvehiclelist.cell[terminal_type_index, I]. Asstring+','+Grdvehiclelist.cell[service_end_date_index, I]. Asstring+','+Grdvehiclelist.cell[remind_index, I].      asstring); End; Slist.savetofile (path);

Save the CSV file via Tstringlist, just loop. Each row in the Add table is recorded and saved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.