Simple Console No Go!

Just starting out? Need help? Post your questions and find answers here.
Gary.Maine
User
User
Posts: 34
Joined: Mon Oct 01, 2018 7:10 pm
Location: Winterport, Maine USA

Simple Console No Go!

Post by Gary.Maine »

This simple code works fine in win10, but no console is diplayed in Ubuntu 18.04?

Code: Select all


OpenConsole("Test")
ConsoleLocate(100,100)

  A$ ="xxxxxxxx"

  PrintN(A$)
Debug A$


Delay(5000)
// Moved from "Bugs - Linux" to "Coding Questions" (Kiffi)
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Simple Console No Go!

Post by Marc56us »

This simple code works fine in win10, but no console is diplayed in Ubuntu 18.04?

Code: Select all

ConsoleLocate(100,100)
Not a bug. (Coding Questions)
F1 - List of Platform-dependent Functions
ConsoleCursor() "On Linux or MacOS, this is ignored as the console is only line based"

:wink:
Gary.Maine
User
User
Posts: 34
Joined: Mon Oct 01, 2018 7:10 pm
Location: Winterport, Maine USA

Re: Simple Console No Go!

Post by Gary.Maine »

Ok, but why is this not working on Linux? Yet it still works on Win10?

Code: Select all

OpenConsole("Test")
;ConsoleLocate(100,100)

  A$ ="xxxxxxxx"

  PrintN(A$)
Debug A$


Delay(5000)
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1287
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Simple Console No Go!

Post by Paul »

Under "Compiler Options" did you set "Executable Format" to "Console" ??
Image Image
Gary.Maine
User
User
Posts: 34
Joined: Mon Oct 01, 2018 7:10 pm
Location: Winterport, Maine USA

Re: Simple Console No Go!

Post by Gary.Maine »

Paul wrote:Under "Compiler Options" did you set "Executable Format" to "Console" ??
No I did not, in Linux or Win10. Is this OS depenent?
Gary.Maine
User
User
Posts: 34
Joined: Mon Oct 01, 2018 7:10 pm
Location: Winterport, Maine USA

Re: Simple Console No Go!

Post by Gary.Maine »

Paul wrote:Under "Compiler Options" did you set "Executable Format" to "Console" ??
Yes that solved the issue. But why is it not the same in Win????? And not Documented?

Thanks for the help!!

Gary
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1287
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Simple Console No Go!

Post by Paul »

MacOS must also be set to Console if you want to compile a console app.

For "Console" the PureBasic help file says...
"If your program is intended to be a pure console application (i.e. not a GUI application which sometimes opens a console) then you must remember to set the executable format to 'Console' when you are compiling your programs."
Image Image
Gary.Maine
User
User
Posts: 34
Joined: Mon Oct 01, 2018 7:10 pm
Location: Winterport, Maine USA

Re: Simple Console No Go!

Post by Gary.Maine »

Thank You!
Post Reply