Recent

Author Topic: MacOS "Hello, World." Console Problems  (Read 3200 times)

c_knowles4834

  • New Member
  • *
  • Posts: 25
MacOS "Hello, World." Console Problems
« on: August 02, 2021, 09:57:21 pm »
Hey fellas,

I finally got Lazarus to run properly without any errors; however, I am trying to go through Marco Cantù book on Object Pascal and have run into a problem.

When trying the first program in the book, I cannot get the console to appear and display "Hello World."

Below is the program I am running:

Code: Pascal  [Select][+][-]
  1. program HelloConsole;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. var
  6. strMessage: string;
  7.  
  8. begin
  9. strMessage := 'Hello, World';
  10. writeln (strMessage);
  11. readln;
  12. end.

I omitted "{$APPTYPE CONSOLE}" due to a message that stated that it was not supported by my target OS and now it says the program ran successfully.  But, I still cannot get a console window to display. 

Any ideas on how to solve this issue?


[Edited to add code tags - please read How to use the Forums.]
« Last Edit: August 03, 2021, 01:16:06 am by trev »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: MacOS "Hello, World." Console Problems
« Reply #1 on: August 02, 2021, 10:24:32 pm »
Try pressing Ctrl+Alt+O in the IDEorView -> Debug Windows -> Console In/Output

c_knowles4834

  • New Member
  • *
  • Posts: 25
Re: MacOS "Hello, World." Console Problems
« Reply #2 on: August 02, 2021, 10:39:57 pm »
Lazarus didn't respond to CTLR+OPT+O, and I don't have a "Console In/Output" in "Debug Windows". 

See image attached:

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: MacOS "Hello, World." Console Problems
« Reply #3 on: August 02, 2021, 11:38:17 pm »
Похоже вы создали приложение Lazarus (LCL)?
Изначально надо создавать обычное приложение (не LCL),  в этом случае ошибки  появляться не должно ({$APPTYPE CONSOLE}).

google translate:
Sounds like you've created a Lazarus Application (LCL)?
Initially, you need to create a normal application (not LCL), in this case, no errors should appear ({$ APPTYPE CONSOLE}).
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: MacOS "Hello, World." Console Problems
« Reply #4 on: August 03, 2021, 01:48:31 am »
1. Project > New Project - Choose simple program
2. Enter FPC code
3. Tools > Options > Debugger > Debugger backend - Toggle LaunchNewTerminal to True
    =or for Lazarus 2.2 RC1 or trunk or fixes 2.2=
    Lazarus > Preferences > Debugger > Debugger backend - Toggle LaunchNewTerminal to True
4. Compile and run.

See attached pic for result.

Note: {$APPTYPE CONSOLE} is not supported by macOS. It does no harm, but has no effect.
« Last Edit: August 03, 2021, 01:52:41 am by trev »

 

TinyPortal © 2005-2018