Discussion:
Serial1.DataAvailable with method call
(too old to reply)
Joe Hughes
2009-02-11 19:19:23 UTC
Permalink
All,

I'm working on a project that controls an LG monitor via the serial
port. I decided on Realbasic because of the GUI the application will
need. I have most of the code in place, but I'm baffled by one thing.
In my Serial1.DataAvailable sub I have this:

'
' Get the response to the command
'
bufferIn = Me.ReadAll

'
' Flush the serial buffer
'
Serial1.Flush

'
' Process the input buffer
'
UpdateNow

bufferIn is a Property and UpdateNow is a Method. I put a break on the
bufferIn and when I get data back I see it in bufferIn. I then step to
UpdateNow and do a step in. It doesn't step in. The debugger acts like
UpdateNow is not there. I'm baffled by the behavior. This is on a
MacMini running Mac OS X (10.5.6) and using Realbasic 2008 Release 5.1.
I have hunted high and low for an explanation, but it eludes me. Does
anyone know what I am missing to make this work?

Thanks,
Joe
Mac Dude
2009-02-12 22:56:19 UTC
Permalink
Post by Joe Hughes
All,
I'm working on a project that controls an LG monitor via the serial
port. I decided on Realbasic because of the GUI the application will
need. I have most of the code in place, but I'm baffled by one thing.
'
' Get the response to the command
'
bufferIn = Me.ReadAll
'
' Flush the serial buffer
'
Serial1.Flush
'
' Process the input buffer
'
UpdateNow
bufferIn is a Property and UpdateNow is a Method. I put a break on the
bufferIn and when I get data back I see it in bufferIn. I then step to
UpdateNow and do a step in. It doesn't step in. The debugger acts like
UpdateNow is not there. I'm baffled by the behavior. This is on a
MacMini running Mac OS X (10.5.6) and using Realbasic 2008 Release 5.1.
I have hunted high and low for an explanation, but it eludes me. Does
anyone know what I am missing to make this work?
Thanks,
Joe
What is UpdateNow? Your own code? If it indeed has no parameters, I'd try
UpdateNow() for the call (i.e. add the parentheses for an empty argument list).

Also, you can try setting a breakpoint in UpdateNow, & just Resume after the
bufferIn... line, which should get you to the next breakpoint. And, make 100%
sure there isn't a way for your code to never get to the call in the first
place.

I don't have as new a version of RB as you have, but the debuggers in the older
versions definitely have their quirks.

Mac Dude

Loading...