Category : Miscellaneous Language Source Code
Archive   : TIPI.ZIP
Filename : BATMENU.TPI

 
Output of file : BATMENU.TPI contained in archive : TIPI.ZIP
# Displays a batch menu
# and runs the chosen function
# by Kent Peterson

defstr valid$

define waitforkey ( -- choice )
( valid$ -- )
27 chr$ +$ # Add the escape character to the end
0 cursor
begin
inkey$ ucase$ # valid$ key$
len instr *
dup
if dup drop$ endif drop$
until
1 cursor
enddef

cls
command$
parse$ drop$
parse$ swap$ drop$
dup$ "" =$ if "Usage: BATMENU menufile" print$ 1 bye endif
"I" swap$ 1 open
1 isinput
"" valid$ store
begin
get$ parse$ dup$ "" =$
if 1 drop$ drop$
else 0 valid$ fetch swap$ +$ valid$ store drop$
endif
until
begin
get$ error
dup if drop$ else print$ cr endif
until

valid$ fetch waitforkey
dup
1 0 filepos drop
"" do drop$ get$ loop
parse$ drop$
1 close
"O" "BATCMD.BAT" 1 open
1 isoutput
print$ cr lf
1 close
cls


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : TIPI.ZIP
Filename : BATMENU.TPI

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/