|Table Of Contents||Index|
In order for MarxMenu to work, a MARX.BAT file must be created. This is done by typing INSTALL. The first thing that INSTALL does is unpack the compressed menu files and documentation files. Then it will bring up the installation menu.
The MARX.BAT file looks like this:
@ECHO OFF C:\MARX\MARXMENU.EXE %1 %MXCMD% MARX %1The first line of MARX.BAT turns the echo off. This may be changed to ECHO ON for debugging purposes. PAUSE commands can be inserted to debug a menu. This allows you to see what's going on.
The second line of MARX.BAT runs MARXMENU.EXE. The second parameter %1 is the name of the menu file to run. A third parameter can be added to tell MarxMenu to use a specific directory for creating temporary batch files. Otherwise MarxMenu will create temporary batch files in the same directory as MARXMENU.EXE.
When the user selects a program to run, MarxMenu writes a temporary batch file which contains within it the commands to run the program. Then MarxMenu writes a command to the environment variable MXCMD to execute the temporary batch file and exits.
What it writes depends on the version of DOS you are running. If you are running DOS 3.3 or later, MXCMD is set to CALL <batch>. If you are running an earlier version of DOS then MXCMD is set to COMMAND /C <batch>.
Whatever command is written to MXCMD is executed in line 3. This usually calls the temporary batch file that MarxMenu created. This executes your program and returns to MARX.BAT.
Line four jumps back to the beginning of the batch file and starts all over. %0 is MARX.BAT and %1 is the name of the menu you are running.
MARX.BAT -------- +--MarxMenu Creates--+ +----> @ECHO OFF | | | MARXMENU.EXE %1 | | %MXCMD% >--+ +-> $MX00000.BAT | +--> MARX %1 + | ------------ | | | +----------------------> CD\WORDSTAR +-|------<-----+ WS --+ | | +-------------------------------------------<-+You can also tell MarxMenu where to put it's temporary batch files by setting an environment variable TEMP to point to a temporary file directory.
Note: MarxMenu sets MXCMD = CALL $MX00000.BAT
Example:This is compatible with the way DOS 5 and Windows uses temp files.
When you exit the menu system. MarxMenu sets MXCMD to MXSTOP. This jumps to a batch file called MXSTOP which gets you out of MARX.BAT. MXSTOP.BAT can be modified to control what happens when MarxMenu is exited.
The default MXSTOP.BAT file is as follows.
SET MXCMD= SET KSV= REM You can control menu exiting with this file!Note that by adding your own commands to MXSTOP that you can control what happens when you exit. You could loop right back to the menu if you want. Or, you could force a controlled network logoff.
I strongly recommend upgrading to DOS 3.3 or later whenever it is possible to do so.
The name of the temporary batch file is as follows:
$MX00000.BAT |||| Shells--------+|++--------Network Station (Hex) Task NumberThe five zeros are used for single user versions of MarxMenu. On a network they change as follows:
The last two zeros is the station number on the network. This is either read directly from the shell, if you are using Novell, or from the environment variable STATION if you are on another network. The third zero is the task number if you are running DesqView, or from an environment variable TASK if you are running some other multitasker.
The second zero is replaced by one less than the number of COMMAND.COM shells you are running. This way if you run COMMAND.COM under MarxMenu and then run MarxMenu again under that, it doesn't get lost when you exit.
The first zero is for future expansion. In case something comes along that we haven't thought of.
If you want to do custom tricks, MarxMenu has an internal variable called MxCmd. Setting this to your own command overrides the way MarxMenu would normally use it.
But now you ask, does MarxMenu leave a trail of batch files that will clutter up my drive or network? Not at all. MarxMenu keeps using the same names over and over again. If a user crashed his system, it might leave a batch file but it would be overwritten the next time he used the menu. Not only that, all batch files can be kept in the same directory so cleaning up is as simple as typing DEL $MX*.BAT!
By writing to the MXCMD variable you can run an EXE or COM file directly without having to create another batch file.
Example:This runs RamMap directly from the MARX.BAT file.
OnKey 'M' |MxCmd = 'RAMMAP'
Another trick is to run another batch file without the CALL statement. This creates a one-way jump to another batch file.
Another debugging feature. You can change the first line of the MARX.BAT file as follows:
@ECHO %MXECHO%This allows you to turn the echo on for debugging purposes by typing:
SET MXECHO=ONThis way you don't have to change the MARX.BAT file to debug. If you use this, make sure that MXECHO is set to either ON or OFF.
|Table Of Contents||Index|