Mac OS X and OpenConsole()

Just starting out? Need help? Post your questions and find answers here.
jermcf
New User
New User
Posts: 2
Joined: Sun Nov 27, 2011 3:54 pm

Mac OS X and OpenConsole()

Post by jermcf »

I recently installed PureBasic 4.60 demo on an iMac running Mac OS X 7.2 Lion.
It's basically working but the OpenConsole() command does not work. Then looking at the forum I saw it mentioned that this feature is not available on the Mac version.

I am looking for a basic to run on a mac to control stepper motors out the USB port. If the console command does not work what other options do I have?

Otherwise this seems like a deal breaker and I need to look for another basic. I chose PureBasic for evaluation, liking it since it ran on a Mac.
Ramihyn_
Enthusiast
Enthusiast
Posts: 314
Joined: Fri Feb 24, 2006 9:40 am

Re: Mac OS X and OpenConsole()

Post by Ramihyn_ »

jermcf wrote:I recently installed PureBasic 4.60 demo on an iMac running Mac OS X 7.2 Lion.
It's basically working but the OpenConsole() command does not work. Then looking at the forum I saw it mentioned that this feature is not available on the Mac version.

I am looking for a basic to run on a mac to control stepper motors out the USB port. If the console command does not work what other options do I have?

Otherwise this seems like a deal breaker and I need to look for another basic. I chose PureBasic for evaluation, liking it since it ran on a Mac.
Hello and welcome to the PureBasic forums :)

Do you really need to open a console or do you just need the "Runprogram" command to control the stepper motors by calling a commandline program?
jermcf
New User
New User
Posts: 2
Joined: Sun Nov 27, 2011 3:54 pm

Re: Mac OS X and OpenConsole()

Post by jermcf »

Thanks for the comment.

I will look into using the command line.
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Re: Mac OS X and OpenConsole()

Post by jack »

you can kind of fake the console() with the EditorGadget

Code: Select all

If OpenWindow(0, 0, 0,817, 817, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  EditorGadget(0, 8, 8, 800, 800,#PB_Editor_ReadOnly)

  lin.l=0
  i.l
  
  For i=1 To 10
    AddGadgetItem(0, lin, Str(i)+" = "+StrD(Sqr(i)))
    lin+1
  Next
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
End
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Mac OS X and OpenConsole()

Post by USCode »

In the documentation it "says" OpenConsole() works for All platforms ... is this a new problem on the Mac or has it never worked?
Even the "Platform-dependent Functions" page in the doc implies this command should work on OS X ...
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Mac OS X and OpenConsole()

Post by michel51 »

USCode wrote:In the documentation it "says" OpenConsole() works for All platforms ... is this a new problem on the Mac or has it never worked?
Even the "Platform-dependent Functions" page in the doc implies this command should work on OS X ...
It make not sense to use the console on Mac, because it's not the same as on Windows.
OpenConsole() is working on Mac.
Open the console directly - it's a tool - and you can work with it. All outputs are shown, inputs will react (?). Try a small snippet to test it.
But the console in Mac is used for a lot of outputs , as you can see, so it makes no sense to use it often.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Mac OS X and OpenConsole()

Post by jesperbrannmark »

Wow there. stop time for a second....
Terminal in Mac OS X... This is basicly "console", now isnt it?
I wouldnt be surprised (but have no desire to test) if the print() commands etc works fine for console output.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Mac OS X and OpenConsole()

Post by michel51 »

jesperbrannmark wrote: Terminal in Mac OS X... This is basicly "console", now isnt it?
No! Console and Terminal are two different tools.
Terminal is like a "command line" tool, which you cannot use for inputs and outputs from PB.
Run the 3 line code in openconsole(), open the console on your Mac (programms/tools/console) and see the last line.
It is like it is! The console commands are not usable on Mac.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
User avatar
Shardik
Addict
Addict
Posts: 2060
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Mac OS X and OpenConsole()

Post by Shardik »

michel51 wrote:
jesperbrannmark wrote: Terminal in Mac OS X... This is basicly "console", now isnt it?
No! Console and Terminal are two different tools.
Terminal is like a "command line" tool, which you cannot use for inputs and outputs from PB.
Run the 3 line code in openconsole(), open the console on your Mac (programms/tools/console) and see the last line.
It is like it is! The console commands are not usable on Mac.
michel51,

sorry that's not correct. Try to use the OpenConsole() command in a
source code and run it from the IDE (for an example and an explanation
take a look into this posting from me). When opening the console please
examine the window title. It displays "Terminal...". So "Console" and
"Terminal" seem to be used as synonyms on the Mac... :wink: And it's no
problem to use the PB console commands as long as you change
"Executable format" in "Compiler/Compiler Options..." from "MacOS" to
"Console" before compiling...
Post Reply