GET_STRREF works, cheers. Yes, I want the actual text, not the strref.
Incidentally,
SPRINT myvar #123
WRITE_ASCIIE offset ~%myvar%~
will write "Haer' Dalis, all of you, stop them!", just as it should.
No, it writes ~Haer'Dalis, all of you, stop them!~ (tildes included). Or it cuts it off around the last word with no closing tilde if you put a #32 after it. Now try putting it in a .tra file and use @123 (or whatever) instead. No tildes, so it's clearly reading them for hardcoded strings (why, I don't know) but not traified ones.
You may want to post the code you're really using.
Not really

. Since I'm working with my own files, it wouldn't help much anway. But if you want an example that *isn't* my code, do something like this:
COPY_EXISTING ar0020.are override
READ_LONG 0x54 act_off
READ_SHORT 0x58 act_num
FOR (i = 0; i < act_num; i += 1) BEGIN
READ_ASCII (i * 0x110 + act_off) act_name
PATCH_IF (~%act_name%~ STRING_EQUAL ~Soldier~ = 1) BEGIN
SPRINT new_name #123
WRITE_ASCIIE (i * 0x110 + act_off) ~%new_name%~ #32
END
END
BUT_ONLY
(I don't care if the "Name" field here isn't really used - it's an example.)