![]() | Chapter 11: Phrases | ![]() ![]() |
11.12. Stop |
Now that it's possible to define phrases where different things are done in different circumstances, we sometimes want to halt early. This is what "stop" is for. Here is a not very interesting example:
To judge the score:
if the score is 0, stop;
say "The score is [score in words] more than it was a half-hour ago."
In the case when the score is 0, the "stop" ends the phrase immediately, so that the subsequent text is printed only if the score is not 0.
Previous | Contents | Next |