Quote Originally Posted by midali View Post
I tried your code...the same. But is something what I don't understand ... I used 2 different variables and work great . It don't work if I use the same variable ! Today I'll try initialisation from Alain's code. In this moment my code work good, but I want to understand whats happen inside.

Code:
varb var byte
vara var byte
varb = 0
vara = 0
 pause 200

init:
 pulsin portc.2 , 1, vara
 if vara < 140 or vara > 160 then init
 pause 100
 pulsin portc.2 , 1, vara
 if vara < 140 or vara > 160 then init
 if vara > 140 and vara < 160 then goto beep
 goto init

beep:
pulsin portc.2 , 1, varb
....code....
goto beep
1000 x THX
Are you saying the init routine works but beep does not work if vara is used but does work if varb is used?
If so I am puzzled.
Can you post the code in beep?