https://www.w3schools.com/php/php_switch.asp
And it says to use "Break" after each "Case" to prevent the code from running into the next case automatically.
We don't have to do this in PureBasic, right? The manual doesn't say to, but after reading the above, I'm not sure.
The PHP example shows "Break" being used after every "Case":
Code: Select all
<?php
$favcolor = "red";
switch ($favcolor) {
case "red":
echo "Your favorite color is red!";
break;
case "blue":
echo "Your favorite color is blue!";
break;
case "green":
echo "Your favorite color is green!";
break;
default:
echo "Your favorite color is neither red, blue, nor green!";
}
?>