Text Window Input-Output Control

version 2 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Section: Transcripts

    With multiple windows, we need a bit more control over what is written to the transcript than the Inform library provides. Text Window Input-Output Control should automatically handle directing the streams of the current text output and current text input windows to the transcript. This is handled internally by the extension in two ways: (1) Through the "activating the transcript" activity, which allows us to dictate which windows send output to the transcript, as well as what is output in response to the SCRIPT ON command. The default is set by the "transcript activation rule," which attempts to echo both the current text output window and the current text input window to the transcript. (2) Additionally, any window opened as the current text input/output window (using the "open ... as" phrases described in the Basic Usage section) after a transcript is already in progress will be added to the transcript.

    If we have a more dynamic window layout, we can add window streams to the transcript manually by using the "echo the stream of <a text g-window> to the transcript" phrase. This can be done both by extending the activating the transcript activity:

        For activating the transcript:
            echo the stream of the optional-window to the transcript.

    ...and by adding rules to Flexible Windows's "constructing a g-window" activity:

        After constructing the optional-window:
            echo the stream of the optional-window to the transcript.

    Including the instruction in the activating the transcript phrase ensures that an existing window will be echoed when a transcript is started, while doing so in the after constructing activity ensures that a window opened after the transcript has begun will also be echoed. Note that the "echo the stream" phrase does nothing if the transcript is not already active, so it is safe to use anywhere in our code.

    We can also stop a window's stream from being echoed to the transcript without closing the window by using this phrase:

        shut down the echo stream of <a text g-window>

    It is also possible to send output to the transcript more selectively; see the "On the Edge" and "Terminal" examples below.