You could, but it just uses more code space. It's pretty much a Select Case the way the last example is shown. But here's a Select Case version...would this be a place for select case?Or, just to keep things nice and confusing, you could also do this...Code:combo: Select CASE combocount Case 0 : if ByteA = 7 then GoodKey Case 1 : if ByteA = 8 then GoodKey Case 2 : if ByteA = "A" then GoodKey Case 3 : if ByteA = 5 then GoodKey Case 4 : if ByteA = "D" then GoodKey END SELECT combocount = 0 return GoodKey: combocount = combocount + 1 if combocount = 5 then GrantAccess returnCode:Combo: Lookup combocount,[7,8,"A",5,"D"], NextDigit if ByteA = NextDigit then combocount = combocount + 1 if combocount = 5 then GrantAccess else combocount = 0 endif returnNope, that can't happen. You should run the program in MCSP debugger and watch what happens. After watching debuggers for awhile, you'll be able to see it in your mind, and programming will go a lot smoother. And eventually, you won't even need the debugger anymore, or the PIC. It'll run inside your head.It seems as though the THEN Goodkey scenerio would make the combination work if out of sequence?
No Problemo!Oh your code works SWEET! Thanks Again.




Bookmarks