In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: As you start to trim and clean things, here's a subroutine you can use to wait for a specific string: [code]SUB WAIT_STR tmpW1 = __WPARAM12 ' starting address of string Reset_Str: tmpW2 = tmpW1 ' copy start DO READINC tmpW2, tmpB2 ' get char from string IF tmpB2 = 0 THEN EXIT ' if 0, we're done tmpB1 = RX_BYTE ' get char from stream IF tmpB1 <> tmpB2 THEN Reset_Str ' if not equal, start again LOOP ENDSUB[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=237315#m237349 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)