Console problems

Mac OSX specific forum
Agent Smith
New User
New User
Posts: 8
Joined: Tue Dec 13, 2005 1:53 am
Location: New Zealand

Console problems

Post by Agent Smith »

Hi all,

I'm using PureBasic 3.94d on Mac OS X 10.3.9.
But I'm having difficulty getting the Console functions to work.

Here's my code (compiled as a 'Console' executable):

Code: Select all

Global char$

Procedure GetChar()
  Shared char$
  Protected key$
  While key$ = ""
    key$ = Inkey()
  Wend  
  char$ = key$
EndProcedure

If OpenConsole()
  Repeat
    GetChar()
    If char$ <> ""
      PrintN("char$ = " + char$)
      char$ = ""
    EndIf
  ForEver
EndIf

End
It seems that Inkey() never returns anything, no matter which keys are pressed. Also, the example Console program doesn't work either. Is there something I'm doing wrong? Thanks for any help.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Post by michel51 »

Hi,

it seems your code is ok.

but I have problems with openconsole() and so on. These problems I have since 3.94d.

I think, it's a bug.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Agent Smith
New User
New User
Posts: 8
Joined: Tue Dec 13, 2005 1:53 am
Location: New Zealand

Post by Agent Smith »

Thanks for that, michel51.

Yes, I think so too because I tried exactly the same program on the Windows version of PureBasic (which I run on my Mac under an emulator) and it seems to work fine.

Oh well, I'll just report it as a bug. Damn nuisance though, I was hoping to do all my development using the native Mac version.
Post Reply