Very quick table question [i7]

Given a variable that is of type table name, is there an easy way to get the short name of the table? That is, if the table name is “Table of Kings” (or maybe “Table 1 - Kings”), I want to be able to get the string “Kings” without messing around with special string operations.

I don’t believe that Inform would have any reason to store the short name of the table, as it doesn’t actually use even the long name internally. Getting the short name is easy, though. Here’s how to do it if you name all your tables “Table of X”:

[code]When play begins:
say “Table: [Table of Kings shortened].”

To decide what indexed text is (tab - a table name) shortened:
let T be an indexed text;
let T be “[tab]”;
replace the text "Table of " in T with “”;
decide on T.[/code]

This should be pretty fast, but if you’re going to be invoking this often (e.g. more than once per turn), you might want to store all of these texts in a table, since table lookup is faster than indexed text manipulation.