Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I want to send ide pascal output to a file that I can print

+3 votes
asked Sep 23, 2023 by donald girod (150 points)
I believe it is possible to redirect output to some kind of file but the redirect command is an ide command and I don't see how to create an ide command.  All that is shown on the screen is "command line arguments".  Maybe a command line argument exists for this but I don't know what it is.

2 Answers

0 votes
answered Sep 25, 2023 by Peter Minarik (86,240 points)
edited Sep 27, 2023 by Peter Minarik

Let's assume you have a simple program, that outputs "Hello World!" on the standard output.

program Hello;
begin
  writeln ('Hello World!')
end.

If you want the "Hello World!" not to be put on the standard output, but into a file, you can achieve this via the "Command line arguments" option, just add the redirect operator (>) and the file name, e.g.: "> hello.txt", into the "Command line arguments" text box.

When you run your code, a new file will be added to your project (in our example, it will be called "hello.txt") and you can observe the content of the file.

I hope this helps.

Good luck! :)

0 votes
answered Sep 27, 2023 by root (810 points)

In Delphi you can programmatically redirect output:

assign(output, '/tmp/foo');
rewrite(output);
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...