Odd debug.print behavior
Posted: 15 October 2009, 14:20 PM
Hi!
Code below works fine but after a minut or so the in buffer stops recieving data ! After trial and terror I found out that if I remove the debug.print "Waiting.." everything works as expected. I think I've read somewhere that debug.print don't effect buffer but in this case it's seems that it does. Anyone have an idea why? It's quite a challenge to find errors in programs if debug.print give you errors.
Regards Hucke
Code below works fine but after a minut or so the in buffer stops recieving data ! After trial and terror I found out that if I remove the debug.print "Waiting.." everything works as expected. I think I've read somewhere that debug.print don't effect buffer but in this case it's seems that it does. Anyone have an idea why? It's quite a challenge to find errors in programs if debug.print give you errors.
Code: Select all
'**********************************************
'****** Task called from Sub Main ***
'****** to check if touch screen pressed ******
'**********************************************
Public Sub CheckLCDTouch_TouchResponse()
Dim tmpResponse As String
Dim tmpCommand As String
TouchRespons = " "
Do
Call ClearQueue((CByteArray(InBuf(1, LCD_touch).DataAddress)))
tmpCommand="K"
Call PrintText_TouchLCD(tmpCommand)' sending a 'K' tells Display to response on touch
tmpResponse = GetQueueStr((CByteArray(InBuf(1, LCD_touch).DataAddress)))
TouchRespons = mid(tmpResponse,4,1) '# or number according to touched button
Select Case TouchRespons
Case "#"'do nothing
Case "1"
Debug.print "Row 1 hit"
Sub_LCDTouch_Menu(TouchRespons)
Case "2"
Debug.print "Row 2 hit"
Sub_LCDTouch_Menu(TouchRespons)
Case "3"
Debug.print "Row 3 hit"
Sub_LCDTouch_Menu(TouchRespons)
Case "4"
Debug.print "Row 4 hit"
'back to Main menu
SubMenu = False
Main_LCDTouch_Menu
Case Else 'error,do nothing
Exit Do
End Select
'debug.print "Waiting..."
Call Sleep(0.1)
Loop
End Sub