Function call to reset global variables

I have a television in my current project. In many circumstances I can set up a conditional to get info about the current show like this:

choose row with a number of theChannel from the table of television shows;
say "You're watching channel [theChannel]. It's running [genre entry]."

But what I really want is a function call (or something) to set global variables that I can access at any time. This way I wouldn’t have to worry about errors creeping into multiple versions of the calculation scattered all over my code. And there are places where Inform doesn’t allow multiline structure at all.

How the heck do you do a function call like that?

I’m a bit rusty but…

[code]The TV channel is a number that varies.

To change the channel to (ch - a number):
now the TV channel is ch;
choose row with a number of ch from the table of television shows;
say “You’re watching channel [ch]. It’s running [genre entry].”[/code]
And then elsewhere in your code when you want the channel changed use the new command ‘change the channel to’ that you have just defined…

change the channel to 5;

If you want this global function to return a value, you can do it more like so…

To decide what number is the changed channel: decide on the TV channel.
Then whenever you say ‘the changed channel’ it will run that function to calculate the value. I’m just typing off the top of my head though and this stuff might not run w/o minor tweaks.

Thanks, L,
I saw that syntax elsewhere, but I couldn’t make any sense of it and wasn’t sure that was the approach I needed. I’m not entirely sure I understand it now, but I’ll plug it in and see if I can get it up and dancing. Gosh, I hope that’s not one of the things that’s being removed in the next version…

Jeez I hope not! I can’t really see myself using a language without an ability to mimick standard procedures and functions. I wonder where I find this list of changes?

Things that are slated to be removed are marked “deprecated”, and appear in the manual with a blue beta (β).

Thanks. I take it ‘manual’ in this case refers to the help available from within the IDE…

Yes. A.k.a “Writing With Inform”, also available at