25.15. Phrases to decide in Inform 6

| Chapter 25: Extensions |

| 25.15. Phrases to decide in Inform 6

There are basically three forms of phrase in I7: phrases which do something, but produce no value or opinion as a result; phrases to decide whether or not something is true; and phrases to decide on a value. We have already seen examples of writing the first form in I6:

> To say (something - number): (- print {something}; -).

Here the I6 form is required to be I6 routine code in void context, that is, it will normally be one or more statements each of which ends in a semicolon (unless there are braced code blocks present). In this case, we have just one I6 statement, ending in a semicolon.

An example of a phrase to decide whether something is true would be:

> To decide whether in darkness: (- (location==thedark) -).

Here the I6 code providing the definition must be a valid I6 condition, and be in round brackets, but there is no semicolon.

Lastly, an example of a phrase to decide on a value:

> To decide which number is the hours part of (t - time): (- ({t}/60) -).

Again, this is a value in I6 as well: no semicolon. It is probably safest to place the value in round brackets.

Previous | Contents | Next