problems with console on mac osx

Just starting out? Need help? Post your questions and find answers here.
vkelmenson
New User
New User
Posts: 5
Joined: Mon Dec 10, 2012 2:27 am

problems with console on mac osx

Post by vkelmenson »

Hi everyone. I am new to PB. I have recently purchased Pb 5.00. I have been experimenting with it for several days. I am having problems with running as a console app.
If I try the following code

Code: Select all

OpenConsole()
Print ("the console has been opened")
Print ("press return to exit")
Input()
CloseConsole()
End
running in the debugger, it hangs up PB and I have to force close it. If I make an executable, it runs but the window closes too rapidly to see.
This is not a major problem as I can use debug, and messageRequester() and inputRequester() to do the same thing. I am running mac osx 10.5.8. Am I doing something wrong? Can I do anything else? Is this a bug? Thanks for any help and information. Victor
infratec
Always Here
Always Here
Posts: 7591
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: problems with console on mac osx

Post by infratec »

Hi vkelmenson,

have you changed the compiler option to 'console' :?:
(executable format)

Bernd
vkelmenson
New User
New User
Posts: 5
Joined: Mon Dec 10, 2012 2:27 am

Re: problems with console on mac osx

Post by vkelmenson »

Bernd:
Yes, I did. I am sorry that I forgot to mention that in my post. Victor
infratec
Always Here
Always Here
Posts: 7591
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: problems with console on mac osx

Post by infratec »

Hi Victor,

to run such a console application you need to create the executable,
open an OS terminal and start the executable from the terminal.

I don't know if it runs correct in OS X under the IDE.

You can try to switch back from 'console' to ??? and execute it than.
In windows, the console window stays than open.

I can test this early tomorrow, since I have no access to a Mac at home.

Bernd
vkelmenson
New User
New User
Posts: 5
Joined: Mon Dec 10, 2012 2:27 am

Re: problems with console on mac osx

Post by vkelmenson »

Bernd, Thanks for the rapid reply.
I tried it with the console open. The message that I printed appears but the app closes immediately and does not wait for return to be pressed. I suspect that this is a problem with how the console works on osx. Victor
infratec
Always Here
Always Here
Posts: 7591
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: problems with console on mac osx

Post by infratec »

Hi Victor,

as promised, I did some tests:

Code: Select all

OpenConsole()
Print("Press return: ")
Input()
Marked it as 'console' in 'Compiler options',
created an executable in 'Downloads' (PB01),
started the OSX terminal programm,
changed the directory to Downloads (cd Downloads),
started it with ./PB01,
and ...
it was working as expected.

Tested with PB 5.0 and 4.61 on Mac OS 10.7.2 X86.

Bernd
vkelmenson
New User
New User
Posts: 5
Joined: Mon Dec 10, 2012 2:27 am

Re: problems with console on mac osx

Post by vkelmenson »

Thinks Bernd
I did the same thing today and it worked perfectly. Actually, I can just double click the file icon and it works. I recompiled the
snippet I wrote yesteday and it also worked. The icon compiled today is different from the icon from when I compiled yesterday. I must have made some mistake in making the executable originally. I am sorry to waste your time because of a mistake. Thanks again. Victor
Post Reply