troubleshooting Question

How to save the file without insert the extension filename

Avatar of firekiller15
firekiller15 asked on
Delphi
4 Comments1 Solution595 ViewsLast Modified:
Delphi
How to save the file without insert the extension filename
How to print .txt on filename textbox  if "save as type is .txt"

i have two type of filename .txt and .csv

below is my code

            begin
              with SaveDialog1 do
              begin
                if Execute then
                begin
                  FileName := SaveDialog1.FileName;
                  if (SaveDialog1.Filter = 'Plain ANSI text files (*.txt)|*.TXT') then
                  begin
                    FileName := ChangeFileExt(vFileName, '.txt');
                    Data.SaveToFile(vFileName); //data is stringlist
                  end
                  else
                  FileName := ChangeFileExt(vFileName, '.csv');
                  Data.SaveToFile(vFileName); //data is stringlist

                end;
              end;
            end;
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros