I did it in the different way:
Code:
setuploop:
if but2=0 then
dlycnt=dlycnt+1 'increase debounce variable while button is pressed
ticker=ticker+1
pause 1
endif
if ticker>1500 and  BUT2=0 then gasvla 'if long pressed, then exit and (or) go to selector item
if BUT2=1 and dlycnt>100 then  'if short pressed, then do the rap
ticker=0
dlycnt=0
menuitem=menuitem+1  'this is incremental variable, substitute another next time you need it
lcdout $fe,$c0, " selection: " #menuitem," "  'debug just for case
pause 1
endif
goto setuploop