Re: Inform: global string arrays


31 Jul 95 13:28:33 BST

...
>>
>> Global v -> "sometext";
>
> It may also help some people (like silly old me) to note that apparently when
> declaring a string in this way double quotes are used, as in "sometext", but
> when reading\writing single quotes are used, as in 'sometext'.
>

Um... no. Text in double quotes, like "frog", is used in two contexts:
(a) as an object "name" value, as in

Object frog "frog"
with name "frog" "toad" "natterjack";
^
^This being such an example

and (b) as a constant string, e.g. to be printed, as in

print "Hello."

Text in single quotes is used for dictionary words (though only fairly
complex Inform programs need to do much with these directly). So

if (word_typed == 'banana') ...

might be an example. The word "banana" is automatically put into the
dictionary by this usage, so that this will work.

Graham Nelson