Real fast - simpl syntax
Philldapill
Posts: 1,283
I have a loop that keeps repeating...
· repeat
··· if condition is satisfied
····· break out of loop and continue
· continuing code...
How do I break out of the loop? In C, it would just be "break" or "return" in the case of returning from the function, but in this case I just want to continue.
· repeat
··· if condition is satisfied
····· break out of loop and continue
· continuing code...
How do I break out of the loop? In C, it would just be "break" or "return" in the case of returning from the function, but in this case I just want to continue.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Repeat until "condition is satisfied"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
You could also do
repeat i from 0 to 15
·· display.out(KeyName[noparse][[/noparse] i ])
Post Edited (Mike Green) : 1/5/2008 12:59:08 AM GMT
Repeat i from 0 to 16
tv.str(string(KeyName))
Seems to not appear the KeyName[noparse][[/noparse]/code]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
17 so that you have space for the 0 termination, the 3rd letter of the 2nd field would be KeyName[noparse][[/noparse]1*17 + 2] (arrays start with 0 index, so each component of the index (record # and offset)·are subtracted by 1)
other: is the default case (this information is in the manual)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (deSilva) : 1/5/2008 2:29:22 AM GMT
·tvtext.str(KeyName[noparse][[/noparse]17 * lookdownz(code : $4B, $7C, $7F)])
code is the code value that you are displaying the name for, KeyName contains the string POWER starting at index 0, PLAY starting at index 17 and STOP at index 34, all other values in KeyName are 0. The effect of this code is to make an array whose indicies are $4B, $7C and $7F
If you want to get even "spiffier" you can use variable length strings using a combo lookup and lookdown:
Pretty cool huh?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 1/5/2008 2:29:27 AM GMT
Have you tried it? Of course not
"string" is no command but a "directive"; it instructs the compiler to allocate some space preset by CONSTANTs only.
The classical program to output a string is
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Negroponte says the OLPC notebook will be $80 end of this year
What is the topic again?
Winter wind rambles.
My haiku for the day.
-Phil
Well done, Phil!
... and you even did't forget the reference to nature and season
Post Edited (deSilva) : 1/5/2008 6:19:29 PM GMT