Hi, I’ve been away from the forum for a while and apparently missed a few things.
I’m stuck on how to check if a file exists.
I think you need some code to handle the “\” character as well.
procedure TForm1.FormPaint(Sender: TObject);
Var
Index:Byte;
T: String;
begin
if ParamCount>1 then Begin
//https://forum.lazarus.freepascal.org/index.php?topic=15715.0
T:='';
TabSheet2.Enabled:=True; //Debug
For Index:=1 to ParamCount do
Begin
T:=T+' '+ParamStr(Index);
End;
LabeledEdit1.Text:=T; //ParamStr(1);
Label9.Caption:=T+'\NC_clean.ini'; //IntToStr(ParamCount);
If FileExists(T+'\NC_clean.ini') Then
Begin
ShowMessage('All is well, I seem to exist.'); //For test
//TabSheet2.Enabled:=True;
End;
end;
end;
I hope this post includes all the necessary information.
So what should I look for to get the program code to “recognize” that the file exists?