Comment ===================================================================== This is an example of a more complex menu system. It shows how the commands are used. Print this out and study it. Some of these examples assume that you own the Computer Tyme DOS Toolbox ===================================================================== EndComment Var ForeColor BackColor ClearChar %ExecSt %BackupPath %Option %Message FileType Procedure SelectFile BoxHeaderColor ForeColor BackColor BoxBorderColor Cyan Mag BoxInsideColor Yellow Mag InverseColor Yellow Red %ExecSt = PickFile FileType 4 5 17 EndProc if ColorScreen Shadow On ForeColor = Yellow BackColor = Mag ClearChar = 32 else Shadow Off ForeColor = Black BackColor = Grey ClearChar = 177 endif Explode SavePosition On BlockBox BoxHeaderColor ForeColor BackColor BoxBorderColor Green Blue BoxInsideColor Yellow Blue InverseColor Yellow Red ConsoleHeaderColor ForeColor BackColor ConsoleBorderColor Yellow Green ConsoleInsideColor LCyan Green BlankTime = 10 BlankMessage = 'Out to Lunch' TextColor Red Red ClearScreen ClearChar TextColor ForeColor BackColor ClearLine Write ' * The MarxMenu System *' GotoXY 1 25 ClearLine WriteCenter 'Copyright 1989-90 by Marc Perkel * All Rights Reserved' ClockColor ForeColor BackColor ClockPos 35 1 TextColor Yellow Blue DrawBox 25 11 30 3 WriteCenter 'MarxMenu Demonstration' Loop 7 MoveWindow 0 -1 EndLoop DrawBox 29 11 22 3 WriteCenter 'Press ESC to Exit' Loop 9 MoveWindow 0 1 EndLoop BoxHeader = ' My Master Menu ' DrawBox 14 9 53 9 UseArrows TextColor LCyan Blue ClearLine 205 TextColor Yellow Blue Writeln Writeln ' A - Run Another Menu G - Pick Directory' Writeln ' B - DM H - Execute File Menu' Writeln ' C - Dos Shell I - Directory' Writeln ' D - Marx NIM J - Backup Files' Writeln ' E - Edit SAMPLE2.MNU K - Free Space' Write ' F - Edit Files L - Format Menu' OnKey 'A' |BoxHeaderColor ForeColor BackColor |BoxBorderColor Yellow Green |BoxInsideColor White Green |%ExecSt = PickFile '*.MNU' 4 5 17 |KeySave = '' Marx %ExecSt OnKey 'B' DropTo DM OnKey 'C' |PassWord('shell',4,4) ;The numbers define where the password box appears |If ExistOnPath('DOLIST.EXE') > '' | %ExecSt = 'DoList' |Else | %ExecSt = 'Command' |Endif DropTo %ExecSt OnKey 'D' Marx NIM OnKey 'E' ME %MenuFileName OnKey 'F' ^Edit OnKey 'G' PD OnKey 'H' ^Exec OnKey 'I' |if ExistOnPath('D.EXE') > '' | %ExecSt = 'D' |else | %ExecSt = 'DIR/W|MORE' |endif %ExecSt Pause OnKey 'J' ^Backup OnKey 'K' |if ExistOnPath('FREE.EXE') > '' | %ExecSt = 'FREE' |else | %ExecSt = 'CHKDSK' |endif %ExecSt Pause OnKey 'L' ^Format OnKey 'Z' |%ExecSt = SelectPath :Exec BoxHeaderColor ForeColor BackColor BoxBorderColor Yellow Green BoxInsideColor LCyan Green InverseColor Yellow Red BoxHeader = ' Execute Menu ' DrawBox 45 16 25 6 UseArrows ClearLine 205 Writeln Writeln ' 1 - Run COM Program' Writeln ' 2 - Run EXE Program' Write ' 3 - Run BAT Program' ;Notice that MarxMenu will execute BAT files! OnKey '1' |FileType = '*.COM' |SelectFile @Echo Executing %ExecSt %ExecSt OnKey '2' |FileType = '*.EXE' |SelectFile @Echo Executing %ExecSt %ExecSt OnKey '3' |FileType = '*.BAT' |SelectFile @Echo Executing %ExecSt %ExecSt :Edit BoxHeaderColor ForeColor BackColor BoxBorderColor Yellow Green BoxInsideColor LCyan Green InverseColor Yellow Red BoxHeader = ' Edit Menu ' DrawBox 47 16 25 6 UseArrows ClearLine 205 Writeln Writeln ' 1 - Edit DOC File' Writeln ' 2 - Edit TXT File' Write ' 3 - Edit MNU File' OnKey '1' |FileType = '*.DOC' |SelectFile TEDIT %ExecSt OnKey '2' |FileType = '*.TXT' |SelectFile TEDIT %ExecSt OnKey '3' |FileType = '*.MNU' |SelectFile TEDIT %ExecSt :FORMAT BoxHeaderColor ForeColor BackColor BoxBorderColor Yellow Green BoxInsideColor White Green BoxHeader = ' Format Floppy Disk Menu ' DrawBox 25 13 44 7 TextColor Yellow Green ClearLine 205 UseArrows TextColor White Green Writeln Writeln ' 1 - Format 360 5 - Format /S 360' Writeln ' 2 - Format 1.2M 6 - Format /S 1.2M' Writeln ' 3 - Format 720 7 - Format /S 720' Write ' 4 - Format 1.4M 8 - Format /S 1.4M' OnKey '1' |%Message = '360k Format with no System Files.' |%Option = '/4' |Format2 OnKey '2' |%Message = '1.2m Format with no System Files.' |%Option = '' |Format2 OnKey '3' |%Message = '720k Format with no System Files.' |%Option = '/N:9/T:80' |Format2 OnKey '4' |%Message = '1.4m Format with no System Files.' |%Option = '/N:18/T:80' |Format2 OnKey '5' |%Message = '360k Format with System Files.' |%Option = '/4/S' |Format2 OnKey '6' |%Message = '1.2m Format with System Files.' |%Option = '/S' |Format2 OnKey '7' |%Message = '720k Format with System Files.' |%Option = '/N:9/T:80/S' |Format2 OnKey '8' |%Message = '1.4m Format with System Files.' |%Option = '/N:18/T:80/S' |Format2 :Format2 BoxBorderColor LCyan Blue BoxInsideColor Grey Blue BoxHeader = ' Drive ' DrawBox 54 17 11 5 TextColor LCyan Blue ClearLine 205 TextColor Grey Blue UseArrows Writeln Writeln ' A:' Write ' B:' OnKey 'A' @Echo Formatting Drive A: %Message @Echo To abort, press CTRL-C. @Echo . FORMAT A:%Option OnKey 'B' @Echo Formatting Drive B: %Message @Echo To abort, press CTRL-C. @Echo . FORMAT B:%Option :Backup BoxBorderColor LCyan Blue BoxInsideColor Grey Blue BoxHeader = ' Backup Hard Disk ' DrawBox 44 17 22 5 TextColor LCyan Blue ClearLine 205 TextColor Grey Blue UseArrows Writeln Writeln ' Entire Disk' Write ' One Directory' OnKey 'E' CD\ BACKUP C: A:/S OnKey 'O' |%BackupPath = SelectPath CD %BackupPath BACKUP C: A: