Author: Igor Siticov
How to implement console input/output for non-console applications?
Answer:
For implementing console input/output for non-console applications you should use
the AllocConsole and FreeConsole functions.
Example below demonstrates using these functions:
1 procedure TForm1.Button1Click(Sender: TObject);
2 var3 s: string;
4 begin5 AllocConsole;
6 try7 write('Type here your words and press ENTER: ');
8 Readln(s);
9 ShowMessage(Format('You typed: "%s"', [s]));
10 finally11 FreeConsole;
12 end;
13 end;