this is part of my code for my clock. I need to stop the clock from counting and set the time using the key pad. the problem is i cant get the digits to change to what i want.I'm using the pic 887

Code:
i var word

loopkeypad:
for i=0 to 20
pause 1
next i
i=1
while i=1
hour=0
seconds=0
mins=0
if num1=0 then hour=1
if num2=0 then hour=2
if num3=0 then hour=3
if num4=0 then hour=4
if num5=0 then hour=5
if num6=0 then hour=6 
if num7=0 then hour=7
if num8=0 then hour=8
if num9=0 then hour=9
'if num1=0 and num0=0 then hour=10
if numstar=0 then i=0
wend
for i=0 to 20
pause 1     
next i
goto loopa