Page 1 of 1
problems with console on mac osx
Posted: Tue Dec 11, 2012 7:46 pm
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
Re: problems with console on mac osx
Posted: Tue Dec 11, 2012 7:52 pm
by infratec
Hi vkelmenson,
have you changed the compiler option to 'console'
(executable format)
Bernd
Re: problems with console on mac osx
Posted: Tue Dec 11, 2012 7:57 pm
by vkelmenson
Bernd:
Yes, I did. I am sorry that I forgot to mention that in my post. Victor
Re: problems with console on mac osx
Posted: Tue Dec 11, 2012 8:06 pm
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
Re: problems with console on mac osx
Posted: Tue Dec 11, 2012 8:40 pm
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
Re: problems with console on mac osx
Posted: Wed Dec 12, 2012 9:13 am
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
Re: problems with console on mac osx
Posted: Wed Dec 12, 2012 5:58 pm
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