werner@pell.anu.edu.au (Werner Nickel) said, in a moment of inspiration:
Here is an example of a function that prints the numbers from
1 to 100. The function prints 20 numbers at a time waiting
for the user to press Cntrl-D after having printed 20 numbers:Print20AtATime := function( ) local i; for i in [ 1 .. 100 ] do Print( i, "\n" ); if i mod 20 = 0 then Print( "Press Cntrl-D" ); Read( "*stdin*" ); fi; od; end;The trick is to use the statement Read("*stdin*") in order to
read from standard input. However, I cannot see how one can erase
the "Press Cntrl-D" since GAP produces a newline after it has read
Cntrl-D.
I know about Read("*stdin*") -- but it is the kludgy C-D and messed-up
output that I am trying to avoid. GAP's help system allows the kind
of thing I am asking for
-- <space> for more --
gets erased after you press space, and goes on, and maybe having q for
quit would be good in my program too, so it would be nice if this
facility was available for gap programs as well as the kernel help
proceedures. It allows for /much/ friendlier programs, and as a
programmer, I strongly dislike writing kludges.
michaelkjohnson