Disregarding specific "say" statements in Release

The title says it all… is there a creative way to implement a sort of

#ifndef RELEASE
    say "This message is intended for developers only."
[/code]for specific say statements, likely in a way so the following fictitious code snippet works...?
[code]if the_list is {5, 5, 5}:
    say "This is a message for everyone.";
    say when not in release "This message is intended for developers only."

Thanks in advance for any help you can provide!

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

I believe they should; #ifdef is a pretty fundamental feature of I6 that’s unlikely to go away. (Using it from within I7 isn’t really intended but c’est la vie.)

1 Like

The problem isn’t the I6 feature – the I6 language is intentionally kept stable as a platform. The problem is how I7 generates I6 code; that’s an evolving process.

1 Like

Woah! Thank you very much! The suggested code works perfectly!

This was probably a dumb question, but I tried to search for a similar post here and I am disappointed in myself that I did not figure out to enter the keyword “ifdef”.

Thanks again!