hi everyone, looking for a fix to my output problem, i am outputing a simple 1-8 on a counter loop on porte on a 18f4550.
Im usine porte 0-2, basically

Code:
cnt=0
loop:
porte = cnt
cnt=cnt+1
if cnt=8 then cnt=0
pause 10
goto loop
heres the problem, im driving an electroni circuit that is not a binary input but it does have a decimal output, it takes 3 inputs and outputs 0-7 but the 3 inputs are not binary, if i treat them as binary it works but the decimal output is out of order.

what i want to do is have a ?sequence? setting like getnextnumber(1,4,3,6,2,7,5,0) <fake code for example only>
in visual basic there is a lookup command, im not sure if there is something like this for pic basic pro.

I could do this with expanded code using lots of if then statements but i would like to keep my code pretty short.
any ideas would be helpfull.