Quick question about command streams in Glulx Inform

The Glulx Inform library defines two streams:

Constant GG_COMMANDWSTR_ROCK 303;
Constant GG_COMMANDRSTR_ROCK 304;

These seem to me to be for reading in commands from an alternate source; that is, other than the player’s typing. Is this how I7’s TEST and Replay commands communicate with the game, or does that happen from without?

Thanks,
Erik

OK, the answer appears to be that the skein uses a different mechanism for inserting commands–at least pulling out the code in blue (see spoilered code) has no effect. So, does this stuff have any use at all in I7? Is it present for the use of I6 debugging tools?

Thanks,
Erik

[ VM_ReadKeyboard a_buffer a_table done ix;
if (gg_commandstr ~= 0 && gg_command_reading ~= false) {
done = glk_get_line_stream(gg_commandstr, a_buffer+WORDSIZE,
(INPUT_BUFFER_LEN-WORDSIZE)-1);
if (done == 0) {
glk_stream_close(gg_commandstr, 0);
gg_commandstr = 0;
gg_command_reading = false;
! L__M(##CommandsRead, 5); would come after prompt
! fall through to normal user input.
}
else {
! Trim the trailing newline
if ((a_buffer+WORDSIZE)->(done-1) == 10) done = done-1;
a_buffer–>0 = done;
VM_Style(INPUT_VMSTY);
glk_put_buffer(a_buffer+WORDSIZE, done);
VM_Style(NORMAL_VMSTY);
print “^”;
jump KPContinue;
}
}
done = false;
glk_request_line_event(gg_mainwin, a_buffer+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, 0);
while (~~done) {
glk_select(gg_event);
switch (gg_event–>0) {
5: ! evtype_Arrange
DrawStatusLine();
3: ! evtype_LineInput
if (gg_event–>1 == gg_mainwin) {
a_buffer–>0 = gg_event–>2;
done = true;
}
}
ix = HandleGlkEvent(gg_event, 0, a_buffer);
if (ix == 2) done = true;
else if (ix == -1) done = false;
}
if (gg_commandstr ~= 0 && gg_command_reading == false) {
glk_put_buffer_stream(gg_commandstr, a_buffer+WORDSIZE, a_buffer–>0);
glk_put_char_stream(gg_commandstr, 10); ! newline
}
.KPContinue;
VM_Tokenise(a_buffer,a_table);
! It’s time to close any quote window we’ve got going.
if (gg_quotewin) {
glk_window_close(gg_quotewin, 0);
gg_quotewin = 0;
}
#ifdef ECHO_COMMANDS;
print "** ";
for (ix=WORDSIZE: ix<(a_buffer–>0)+WORDSIZE: ix++) print (char) a_buffer->ix;
print “^”;
#endif; ! ECHO_COMMANDS
];

They appear to be vestigial. But if you added the appropriate debugging verbs back in (they were called “commands on”, “commands off”, “replay” in I6) then they would work.

Great, thank you for the context! I’m working on an extension for creating more flexible input loops and wanted to know if it was safe to just ditch all that stuff so that the loop can be more easily rewritten in I7 code.

–Erik