Recent

Author Topic: Hello World-Prog into DOS box  (Read 1082 times)

McWilliamsPete

  • Newbie
  • Posts: 2
Hello World-Prog into DOS box
« on: November 12, 2020, 09:39:35 pm »
in Win 10 i want to test output "Hello World" to a DOS-box from IDE with F9 start.
I get the DOS-box, but Writeln shows nothing.
Are there sample instructions/a demo prog as to how to run a DOS-box?
Thanks
Pete

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Hello World-Prog into DOS box
« Reply #1 on: November 13, 2020, 01:32:40 am »
Did you use "Host application" in "Run parameters" to open the program in a console (if that's what you mean by "DOS box")?

If so, the normal F9 runs the program inside a debugger session so it might not work as it should through an intermediate "launcher": the debugger might try to debug the host application instead of your program. Try using "Run without Debugging" and see if that works. 
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

ASBzone

  • Hero Member
  • *****
  • Posts: 616
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Hello World-Prog into DOS box
« Reply #2 on: November 13, 2020, 05:36:59 am »
in Win 10 i want to test output "Hello World" to a DOS-box from IDE with F9 start.
I get the DOS-box, but Writeln shows nothing.
Are there sample instructions/a demo prog as to how to run a DOS-box?
Thanks
Pete
Can you show us the program you used to perform this test?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.0.13 r64843 / FPC v3.2.1-r49055 (via FpcUpDeluxe) -- Windows 64-bit install w/Win32 and Linux/Arm cross-compiles
Primary System: Windows 10 Pro x64, Version 2009 (Build 19042)
Other Systems: Windows 10 Pro x64, Version 2009 (Build 19042) or greater

McWilliamsPete

  • Newbie
  • Posts: 2
Re: Hello World-Prog into DOS box
« Reply #3 on: November 13, 2020, 12:55:57 pm »
I started again fresh and found a project option for "console application" (Konsolenanwendung). Now it works, Thanks!

Program:
Program Test_Hello_World (input, output);
var
   sDummy                : String;
begin
   writeln ('Hello, World!');
   read (sDummy);
end.

Bart

  • Hero Member
  • *****
  • Posts: 4512
    • Bart en Mariska's Webstek
Re: Hello World-Prog into DOS box
« Reply #4 on: November 13, 2020, 01:32:49 pm »
Unless you use mode Iso, you do not need the (input, output) parameters.

Bart

 

TinyPortal © 2005-2018