Thanks Henrik,

I have used your suggestion... Program is working good.

Good catch on the duplicated "16". (it is correct in my case, though)

I am always amazed at how one can look at someone elses code and follow it through with logic. The person writing the code uaually has "eat,slept and breathed" their code as they write and debug it. But the person trying to help is looking at the code for the first time, cold.

The reason I skip 8 and have 16 twice in the lookup is because PortA.3 is an input only pin. So I am using bit A.4 then B.4 next. So I just write the walking bit to the A port for the first 4 postions, then the B port for the next four.

Code:
lookup r, [1,2,4,16,16,32,64,128], row  'creates walking "1" for row scanning
            if r<4 then 
            PortA=row          'PortA 0,1,2,4 is connected to row 1-4 
            Else 
            PortB=row          'PortB 4,5,6,7 is connected to row 5-8
            endif
Thanks for your help