Home > Back-end >  Delphi how to use the current date for the file name saved?
Delphi how to use the current date for the file name saved?

Time:10-19

Today is March 31, 2013, for example, click save directly saved in 2013331. After TXT thank you

CodePudding user response:

 
Var
F: TextFile;
S: a string;
The begin
DateTimeToString (s, 'yyyymmdd', now);
AssignFile (f, s + '. TXT ");
Rewrite (f);
CloseFile (f);
end;

CodePudding user response:

Could you tell me how to set path confirmed, thank you don't know if I can do so
I:=(' yyyymmdd ', now)
Memo1. Lines. SaveToFile (F: \ IntToStr (I) + '. TXT ");

CodePudding user response:

Memo1. Lines. SaveToFile (' F: \ '+ IntToStr (I) +'. TXT ");

CodePudding user response:

Thank you, finally press Memo1. Lines. SaveToFile (' F: \ '+ IntToStr (I) +'. TXT '); Realized, for the whole day

CodePudding user response:

reference 4 floor u010114360 response:
thanks, finally according to Memo1. Lines. SaveToFile (' F: \ '+ IntToStr (I) +'. TXT '); Realized, for the whole day


A good reading to learn well, so don't have to waste all day,,, good the junction post bar,

CodePudding user response:

CodePudding user response:

Passing play soy sauce ~ ~

CodePudding user response:

Can use the function gets the current directory of the program, the specific function of baidu,

CodePudding user response:

Late, make a sauce, such as the building Lord scattered points!
  • Related