Disregarding specific "say" statements in Release

You can define a section of your code as “not for release.” (See §2.9.) Then you can set a flag in that section that governs a phrase so it only prints out when not in release mode:

[code]Section - Defining Debugging

Debugging is a truth state that varies. Debugging is false.

Section - Setting Debugging (not for release)

When play begins: Now debugging is true.

Section - Debug Say

To debug say (T - text):
if debugging is true:
say T;
say line break.

Section - Somewhere in the actual main code of the game

:

if the_list is {5, 5, 5}:
say “This is a message for everyone.”;
debug say “This message is intended for developers only.”[/code]

And here’s an old thread with lots of other solutions, some of which actually keep the debugging lines out of your compiled file like a true #IFDEF. The “Debugging” extension mentioned there requires the “Boolean Variables” extension; both can be found here. (My solution above was more or less copied from that, except the extension gives you the ability to toggle “debug” on and off.) Since that thread dates back a couple versions of Inform (I think), I don’t guarantee that the Inform 6-involving solutions still work.

1 Like