In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mslattery wrote: Still stuck.... sorry, I must be missing something... [code] temp3 = 1 'index starts at 0, so send 2nd string temp4 = 0 ' current offset do while temp3 > 0 read menumain + temp4, temp5 temp4 = temp4 + temp5 inc temp4 'For 0 at the end of string dec temp3 loop do inc temp4 'For string size byte read menumain + temp4, temp5 exit if temp5 = 0 LCD_OUT temp5 INC temp4 loop [code]MenuMain: DATA 11,"asdfklke ka", 0 DATA 8,"mike8cha", 0 The menu has been changed to protect the innocent! :) However, this is not behaving as expected... the only difference between this code and the original LCD_STR code is the lack of supporting the Z flag... but when I add menumain = menumain + Z it fails because menumain is a string pointer I believe.... so is that what is failing here? If so... I would like to just extend LCD_STR to include a third parameter (index) that would handle this... but I had problems doing that as well... For reference here is the LCD_OUT and LCD_STR as they exist today... [code] ' ------------------------------------------------------------------------- ' Use: LCD_OUT theByte {, count } ' -- sends "theByte" to LCD [optional] "count" times ' -- "count" defaults to 1 if not specified LCD_OUT: temp1 = __PARAM1 ' save the byte IF __PARAMCNT = 2 THEN ' "count" specified? temp2 = __PARAM2 ' yes, save ELSE temp2 = 1 ' no, set to 1 ENDIF DO WHILE temp2 > 0 SEROUT LcdTx, LcdBaud, temp1 ' transmit to LCD DEC temp2 LOOP RETURN ' ------------------------------------------------------------------------- ' Use: LCD_STR [ string | label ] ' -- "string" is an embedded literal string ' -- "label" is DATA statement label for stored z-String LCD_STR: temp3 = __PARAM1 ' get string offset temp4 = __PARAM2 ' get string base DO READ temp4 + temp3, temp5 ' read a character IF temp5 = 0 THEN EXIT ' if 0, string complete LCD_OUT temp5 ' send the byte INC temp3 ' point to next character temp4 = temp4 + Z ' update base on overflow LOOP RETURN [/code] Thanks, Mike ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=136007#m136139 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)