TADS 3: Two Programming Questions

Two TADS 3 programming questions:

  1. I have a vector. Each element in the vector has this basic structure:


I would like to refer to each item in an element by a symbolic name, not by an index. Is it possible? If yes, how?

For example, instead of


I want to write something like


  1. When I read a Text file, the first line (and only the first line) is prepended with three characters…’\uFFFD\uFFFD\uFFFD’. Why? How do I turn it off?

My gut instinct is not to use a vector like that, but to store the values in an object. As well as being easier to understand, you’ll avoid opaque runtime errors where you accidentally access the wrong element. Are you generating this vector from a file? Even if it’s unavoidable to have this vector at one point, I think the only thing you should ever do with it is stick its values into a more usable object. i.e.

class: LoadedData: Object
          store_number=inList[0];  //can't remember if TADS lists are zero-based

A little googling suggests it represents a character that couldn’t be converted to unicode. I’m not sure exactly what’s happening for you (hopefully someone else can help) but it might help to make sure you only ever edit the text file in a plain text editor (if you weren’t already).