Hello I'm new here. Normally I would bother you guys with this but after hours of searching and lurking I can't find anyone with the same problem.
Anyway I'm making a simple program for my school project using lazarus and I ran into a very interesting problem. Apparently the TProcess.execute function does not like the reset function and won't allow the program to run unless the assignfile command is given the full path to the file otherwise it just gives an invalid file name error for the reset command.
The code I'm using is like this:
AProcess:=TProcess.Create(nil);
AProcess.Executable:=Processname;
AProcess.Options :=AProcess.Options + [poNewConsole, poWaitonExit];
AProcess.Execute;
AProcess.Free;
And the code in the other program:
assignfile(Filemember, ExpandFileName('../Files/members.txt'));
reset(Filemember);
But if I hard code the Full path into the assignfile command without using expandfilename it works fine.
I'm not familiar with all the parameters associated with TProcess and the wiki is not very informative so if you guys could help it would be appreciated.
P.S. I can't just hard code the Path of the file in as I require this program to be portable.