Strings are arrays of characters that can be printed in a text box, said by an object, read from the user, and manipulated with string functions.

Here are the different ways to declare a string:


string Name;         // unique empty string
string NameList[20]; // array of unique empty strings

It is usually necessary to declare any string that is modified during the game, because any matching literal strings will share the same index in the game's string table (so if one is modified, the others are too). Declaring the string guarantees that it has a unique entry in the string table. All strings declared in this way are initialized to by empty.

Arrays of strings are useful for allocating multiple unique entries in the string table. The subscript value in the declaration must be a positive number. The strings in an array of N elements are indexed from 0 to N minus 1.

Remember, it is not possible to assign one string to another, as it is with variables. Strings are really just constant indecies into the string table, so you must use string functions to copy them instead.

See Also...