Recently I got Thaumistry: In Charm’s Way and the other day I was looking through its folder. There’s a patch file called patch.t with this comment at the very top:
- WARNING: Due to a TADS bug, string expressions within “if”, “for”, “while”, and “?:” statements
- can result in nil object reference runtime errors or wrong results. All such comparisons must be
- performed outside of such statements and their result stored in a local variable.
- “switch” statements cannot be used. They must be converted to their if-else equivalent.
I’m working on a TADS 3 game and this comment got me worried because my source includes several places where an if() or switch() statement uses strings. Can anyone confirm that this is, indeed, a bug in TADS 3 and what are the exact situations where this would manifest itself?
There are ways around this problem but they’re all very cumbersome and are hard to remember and the comment is vague about exactly what scenarios break.