Page 1 of 1

OpenConsole() issue

Posted: Fri Apr 08, 2011 3:55 am
by DarkRookie
I am running 4.51 x64 on Mint 10
The OpenConsole() doesn't open anything. Am I missing something?

Re: OpenConsole() issue

Posted: Fri Apr 08, 2011 4:36 pm
by idle
Did you set the executable format to console in compiler options.

Re: OpenConsole() issue

Posted: Fri Apr 08, 2011 7:34 pm
by DarkRookie
Nope. Didn't know that option was there. Used to Windows
Thanks for the fix.

Re: OpenConsole() issue

Posted: Sun Dec 02, 2012 7:45 am
by Robynsveil
Setting Executable format to console has made no difference: nothing shows up. No dialogue, no nothing.

Why is this so difficult? I'm trying to execute this code from the Willloughby book:

Code: Select all

If OpenConsole()
  PrintN("1. Official PureBasic Home")
  PrintN("2. Official PureBasic Forums")
  PrintN("3. PureArea.net")
  PrintN("")
  PrintN("Enter a number from 1 To 3 and press Return: ")
  Destination.s = Input()
  Select Destination
    Case "1"
      RunProgram("http://www.purebasic.com")
    Case "2"
      RunProgram("http://forums.purebasic.com")
    Case "3"
      RunProgram("http://www.purearea.net")
    EndSelect
  EndIf
End
...and bugger-all happens. Am I the only one who is actually using Linux in Purebasic?

Re: OpenConsole() issue

Posted: Sun Dec 02, 2012 11:46 am
by freak
OpenConsole() opens the channel for console output. If you run the compiled program inside a terminal you will see the console output.

Unlike on Windows, the 'console window' on linux is really an external program (a terminal emulator) in which you must run your program in order to see the output. You cannot start it from inside your program.

Btw, please don't repost the same question in many different topics. You won't get better answers that way. One topic is enough.

Re: OpenConsole() issue

Posted: Sun Dec 02, 2012 12:45 pm
by Robynsveil
freak wrote:OpenConsole() opens the channel for console output. If you run the compiled program inside a terminal you will see the console output.

Unlike on Windows, the 'console window' on linux is really an external program (a terminal emulator) in which you must run your program in order to see the output. You cannot start it from inside your program.

Btw, please don't repost the same question in many different topics. You won't get better answers that way. One topic is enough.
Thanks for that, Freak. I've been working with this for the past 6 hours without any answer on the threads nor any clue in the documentation... thank goodness Fred pointed out to me where I was going wrong.

So, that tutorial by Gary Willoughby is useful only to Windows users, then. He failed to mention that. I guess he thought that no need to include any other than Windows users, really... Gotcha. Thanks for the heads-up. :)

Re: OpenConsole() issue

Posted: Thu Feb 07, 2013 7:33 am
by Jacobite
In the manual it says:
On Linux and OS X, this command has no effect, as there is no special 'Console' format.
But after setting compiler options to "console", the console example program "console.pb" ran just fine. The console was launched from the IDE, although it was a smaller window than my xterm settings give when launching a console in the "normal" way. I'm using Xubuntu 12.04.