$! REPEAT.COM
$! written by ACSakovich, ca 1990
$!
$! Correct syntax is:
$! repeat command This will repeat the command until the user presses
$! the exit key (F10, Ctl-Z) or one of the special
$! command keys: C (clear), W (132 col wide), N (80
$! col narrow)
$!
$ esc[0,8] = 27
$ command = ""
$ on control_y then goto terminate
$ open/read user$input 'f$trnlnm("sys$command")
$ write sys$output "''esc'[H''esc'[J"
$ term$page = f$getdvi("TT:","TT_PAGE")
$ set message/nofac/nosev/noid/notext
$ loop:
$ 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8
$ read user$input command/time_out=1/end_of_file=terminate/prompt=" "
$ write sys$output "''esc'[0;0H"
$ if command .eqs. "" then goto loop
$ if f$edit(command,"upcase") .eqs. "C" then write sys$output "''esc'[H''esc'[J"
$ if f$edit(command,"upcase") .eqs. "W" then set term /wid=132
$ if f$edit(command,"upcase") .eqs. "N" then set term /wid=80
$ command = ""
$ goto loop
$ terminate:
$ set message/fac/sev/id/text
$ write sys$output "''esc'[''term$page';1H''esc'[K"
$ exit