![Gordius TinyBox Скачать руководство пользователя страница 61](http://html1.mh-extra.com/html/gordius/tinybox/tinybox_user-manual_2244906061.webp)
60
5.8.3.
while statement
The while statement has an identical syntax as the if statement :
while (
condition
) {
// any number of commands…
}
5.8.4.
switch statements
A switch statement is a shortcut for a long series of if statements. It is used to check a variable against
a larger series of different possible values.
-
for a numeric variable :
switch(
¤tPreset
) {
case 2:
// any number of commands
break
case 15:
// any number of commands
break
case 123:
// any number of commands
break
default:
// if none of the above values match
// execute the commands in this segment
break
}
-
for a string variable :
switch(
¤tSong
) {
case “Go with the flow”:
// any number of commands
break
case “No one knows”:
// any number of commands
break
case “Do it again”:
// any number of commands
break
default:
// if none of the above values match
// execute the commands in this segment
break
}
Содержание TinyBox
Страница 1: ...THE TINYBOX User Manual v 1 4...