Hi Thaddy, many thanks for your solution to the RT103. ,{$apptype console} was missing in my code . Tou made my day ! Cheers !
uote author=Thaddy link=topic=71779.msg560864#msg560864 date=1752667979]
103 is one of the errors you can get when stdin/out/err or in real Pascal output/input and erroutput are not set.
On Windows, Lazarus defaults to that in a GUI application. (Why I do not know, it is a windows only issue)
If you add {$apptype console} these handles will be created.
You can subsequently hide the console window in code..
It is a really stupid decision that Lazarus works like that on Windows, but Hey who am I to complain?
The developers are aware of that
platform only issue.

There is no valid reason for it to be not solved after years from a technical point of view.
Btw this non-feature is Delphi compatible....
And the solution is pretty easy:
program DummyHandles
var
dummy: TextFile;
begin
// Redirect standard output to NUL
Assign(dummy, 'NUL');
Rewrite(dummy);
Output := dummy;
// Redirect standard input (optional, if used)
Assign(dummy, 'NUL');
Reset(dummy);
Input := dummy;
// Redirect standard error
Assign(dummy, 'NUL');
Rewrite(dummy);
ErrOutput := dummy;
// Test output
WriteLn('This will be discarded.');
WriteLn(ErrOutput, 'This error message is also discarded.');
// Don't forget to close when done
Close(dummy);
end.
I did not write that. Copilot did. But I tested it with Lazarus in a gui app.
I did replace the silly assignfile from that query and replaced it with the proper assign, though. And as such I removed sysutils.
Now this only has to be implemented deep in the sources, where file handling is abstracted away from the basics.
In Linux this is already the case: /dev/nul handles for GUI apps.
The effect is that the early 100 errors no longer occur.
Btw. AI help aside, I thought I had provided a similar example to solve it 15 years ago. NUL is a valid windows device handle.
[/quote]