In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Bean, Like Keith, you have a subtle bug in your answer. If you enter the "Do" with P =7 and X = anything other than 1, then the first conditional check will drop execution out of the loop and thus never get to the conditional check for P = 7 which is true. This means that you'll never execute when P = 7 unless X = 1, which is not an "OR", but an "AND". The flag solution I presented earlier doesn't suffer from this problem. [list]Thanks, PeterM[/list] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=156195#m156347 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)