Mega Code Archive

 
Categories / Delphi / Examples
 

Console in non-console applications

procedure TForm1.Button1Click(Sender: TObject); var s: string; begin AllocConsole; try Write('Type here your words and press ENTER: '); Readln(s); ShowMessage(Format('You typed: "%s"', [s])); finally FreeConsole; end; end;