REPEAT loops
codeking
Posts: 39
repeat count decreases count once every loop and stops when is gets to zero.· But can I make a loop that loops until I say count = 0?· For example:
REPEAT UNTIL count = 0
·· IF something
······ count = 0
REPEAT UNTIL count = 0
·· IF something
······ count = 0
Comments
PUB writestr | p···
··· p := 0
··· print_string(string(13,13,"· Enter starting address to read:· "))
··· repeat until· (msg[noparse][[/noparse]p] :=key.getkey) == 13
····· print(msg[noparse][[/noparse]p++])
··· print(13)
··· sendstr(@msg)
··· print(cls)
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?
Newzed@aol.com
·
Here are a couple of examples:
Also a cute trick to remember is:
Since Non-zero is considered true. Saves you a logical comparison. (This was done in one of the examples)
Great for things like
repeat while LOCKSET(myLock) ' Halt for semaphor