I use the ShellExecute command to run an exe file that receives an input text file and returns an output text file. I wrote it like this:
ShellExecute(mainFormHandle, 'open', 'Test.exe',
'input.txt output.txt', nil, sw_shownormal);
S_List.LoadFromFile('output.txt');
Writeln(S_List[0])
Before executing this command, I provide the input.txt file. At each start of my program, the input file is changed, as well as the output file.
The problem is this: I do not see the changes in the output file! A line written in the console refers to the previous file, not the new one. I mean, the file in explorer is modified, but the file I read is still the old file.
It seems a little strange, but I was wondering if there is a way to update the output file before reading it? Or am I missing something here?
Thanks in advance.