In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: I have some PBASIC code that I want to convert in function to SX/B code. Is my SX/B code correct or is there a better way to do this? 'PBASIC code (working) TimeMessages: IF ((hrs >= $00) AND (hrs < $12)) THEN 'Coding here "Good Morning"..... ELSEIF ((hrs >=$12) AND (hrs < $18)) THEN 'Coding here "Good Afternoon".... ELSEIF ((hrs >=$18) AND (hrs < $24)) THEN 'Coding here "Good Evening"..... ENDIF RETURN ' SX/B equivalent?? - Does this look right? TimeMessages: IF TimeDate(Hrs) >= $00 THEN IF TimeDate(Hrs) < $12 THEN 'Coding here "Good Morning"..... ENDIF ENDIF IF TimeDate(Hrs) >= $12 THEN IF TimeDate(Hrs) < $18 THEN 'Coding here "Good Afternoon"..... ENDIF ENDIF IF TimeDate(Hrs) >= $18 THEN IF TimeDate(Hrs) < $24 THEN 'Coding here "Good Evening".... ENDIF ENDIF RETURN ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=184018 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)