Question about Repeat and Quit
karakiko
Posts: 11
Hello forum,
I am using the Parallax Serial Terminal to send ASCII strings to run a routine, the routine is :
when i am writting in PST LednOnOff the routine is running and the program is working good, but sometimes i need·to quit from this loop, how·can i do this ?
Thanks in advance,
Karakik
I am using the Parallax Serial Terminal to send ASCII strings to run a routine, the routine is :
PUB LedOnOff( num,value ) repeat test2.writeLed1(0,0) test2.writeLed1(1,250) test1.writeLed(1,250) test1.writeLed(0,250) WaitCnt(OneSecond + Cnt)
when i am writting in PST LednOnOff the routine is running and the program is working good, but sometimes i need·to quit from this loop, how·can i do this ?
Thanks in advance,
Karakik
Comments
With the quit instruction. It leaves the level of repeat you are in and continues as if the repeat condition had expired. A repeat alone has the condition "always", but quit still leaves the loop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
You will have some condition when to quit? If the name of that condition is test_quit, then you just do
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA