Forum > macOS / Mac OS X

MacOS "Hello, World." Console Problems

(1/1)

c_knowles4834:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program HelloConsole; {$APPTYPE CONSOLE} var strMessage: string; beginstrMessage := 'Hello, World';writeln (strMessage);readln;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.]

howardpc:
Try pressing Ctrl+Alt+O in the IDEorView -> Debug Windows -> Console In/Output

c_knowles4834:
Lazarus didn't respond to CTLR+OPT+O, and I don't have a "Console In/Output" in "Debug Windows". 

See image attached:

Seenkao:
Похоже вы создали приложение 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}).

trev:
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.

Navigation

[0] Message Index

Go to full version