Page 1 of 1

Console problems

Posted: Sat Mar 04, 2006 10:13 am
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.

Posted: Sun Mar 05, 2006 9:06 pm
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.

Posted: Sun Mar 05, 2006 11:58 pm
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.