Detect compiler version at build time?

Dear all,

I’d like to show a line like “built with TADS 3.1.3 and adv3Lite 1.0” in the game I’m working on, and I want the version number to be automatically generated.

For adv3Lite library I can use moduleAdv3Lite.version(), however I haven’t figured out a way to generate the TADS compiler version. There are ways in the documentations about detecting the VM version when the game is run, but it seems nothing is mentioned about detecting compiler version at build time.

Can someone help me out here? Thanks.

The VM version will be the compiler’s version if you make sure that the code that fetches that information is scheduled to run at preinit time so that it’s the compiler that runs it, not the interpreter the game runs in.

So if you read it in a PreinitObject, you should be getting the compiler version.

This works like a charm. Thanks Nikos!