SRL Archive - Help and Support

FileExists


WhoCares357

2009-04-11 19:33:00

I'm trying to make an ini file and then checking if it exists.

program New;

var
FileLoc, FileName: String;

begin
FileLoc := AppPath + 'Scripts\scriptv5\';
FileName := 'MainForm.ini';

WriteINI('SRL-Stats', 'SRLID', 'name', FileLoc + FileName);

if (FileExists(AppPath + FileName)) then
begin
WriteLn('exists');
end else
WriteLn('does not exist');
end.

It outputs "does not exist".

Am I using it wrong or is it broken?

almost

2009-04-11 19:49:53

if (FileExists(FileLoc + FileName)) then
You just need FileLoc and it works.

WhoCares357

2009-04-11 21:12:22

From: almost
if (FileExists(FileLoc + FileName)) then
You just need FileLoc and it works.


Wow. :D I was tired when I was working on it. Thanks.

almost

2009-04-12 00:49:47

It's ok.
I tested what you posted and it took me like 10 minutes of being really confused to see that.