home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1994 February
/
psl_9403.zip
/
psl_9403
/
DOS
/
UT_SYSTM
/
ICONDOS.ZIP
/
RUN.DOC
< prev
next >
Wrap
Text File
|
1993-11-11
|
4KB
|
87 lines
RUN.DOC
IconDOS is basically a graphical front-end to a batch file, RUN.BAT. The
batch file does all of the real work of actually running a DOS command
set corresponding to the selected icon and returning control back to the
IconDOS menu front-end once it is finished. RUN.BAT is composed of 3
general sections:
1) Command Dispatcher - Sends execution to a label matching the first
parameter passed to the batch file.
2) Command Sets - A set of DOS commands for each icon. Each command set
starts with a unique label and ends with a "goto"
statement which sends control to the cleanup section.
3) Cleanup - Returns to the IconDOS directory, reloads Icondos and
re-displays the correct menu.
More specifically, RUN.BAT is similiar to the following:
Batch Command │ Comments
──────────────┼──────────────────────────────────────────────────────────
@echo off │<-- Turns echo off so the following commands don't display
goto %1 │<-- sends control to the label matching the first parameter
│ passed to RUN.BAT by the icon command string.
│
:label1 │<-- Unique label identifying this command set.
(DOS commands)│<-- User supplied DOS commands for command string: RUN LABEL1.
goto done │<-- Sends control to the cleanup area labeled :done below.
│
:label2 │
(DOS commands)│<-- User supplied DOS commands for cmd string: RUN LABEL2
goto done │<-- Jump to cleanup area. This should be the last line in
. │ each command set.
. │
. │<-- (add more labels/command sets as needed here, one per
. │ icon)
:labeln │
(DOS commands)│
goto done │
│
:done │<-- cleanup label
CD\menu │<-- return to IconDOS directory in case it was changed above
ICONDOS mymenu│<-- return control back to IconDOS and 'mymenu'
Appropriate command strings must be assigned to the icons in order to
interface with RUN.BAT. These command strings should be similiar to the
following:
Icon Generic Icon Command String Specific Examples
_______________________________________________________________________________
1 RUN label1 RUN WP
2 RUN label2 RUN 123
3 RUN label3 RUN DBASE
. . .
. . .
. . .
RUN.BAT is initially configured to operate as a demo which simply
displays a message identifying the selected icon where (DOS commands)
are shown above.
ALTERNATE SETUP
If you feel that the above is too complex for your taste, there is
nothing to prevent you from setting you a single, individual batch file
for each icon. The name of the batch file would be entered as the
icon's command string. The last step in the batch file should be to
return control to IconDOS.
This alternate approach is perfectly valid but it is more wasteful of
disk space due to the way a hard drive works. Every disk file is stored
as a chain of clusters. A cluster is simply a fixed minimum unit of
storage set by the hard drive manufacturer. Clusters are most often 4K
in size; however, 2K clusters are also used. Partial clusters are NEVER
allocated; therefore, a batch file that is 400 bytes in size requires 1
full cluster for storage which wastes 3696 bytes out of a 4K cluster.
This may not seem like much but it adds up quickly. Creating a menu
with only ten icons using this approach would waste 36K of disk space.
Using a single batch file containing multiple named command sets, as
described above, is the more efficient, preferred approach.