Adding variables to AssignFile command


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by RSQJohn on May 20, 2003 at 13:25:22:

Hi there, I am trying to create a file at runtime with the code

AssignFile(FOut,'C:\emails\john.txt');

This works fine, what I need to do is stick a variable in there so that each file I create has a different filename. I tried

AssignFile(FOut,'C:\emails\'+dateToStr(date)+'.txt');

but it came up with "Invalid Filename" when I tried to open the file with

rewrite(FOut);

Any help would be great :)


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]