0

I am trying to define a list in Inform7 but it won't work.

Contacts is a list {"Melissa", "Paul"};

That does not work. Can you tell me how to define a list to which elements can be added?

18zehn
  • 142
  • 8

1 Answers1

1

You'll need to first define what kind of values the list holds before you can define what actual values it holds.

Contacts is a list of text that varies. Contacts is {"Melissa", "Paul"}.

This creates a global list that's accessible from anywhere. In rules and phrases you can create a list of constants (text, in this case) with a shorthand:

Instead of examining the phone book:
   let contacts be {"Melissa", "Paul"};
    ...

(See also Writing with Inform ยง21.2.)

JJJ
  • 31,545
  • 20
  • 84
  • 99