home *** CD-ROM | disk | FTP | other *** search
- REVISION HISTORY
-
- 25OCT93: settings.exe; sprintf pid into term queue name
- 11OCT93: fix rexx file search bug; tweak readme
- 09OCT93: tweak readme; new Rexx API SetSessionTitle()
- 21SEP93: new Rexx API SetCommandArgs()
- 27AUG93: default session full screen; searches PATH environment
- for CMD file; startdata length changed to 32.
- 06MAY93: first release.
-
- ---------------------------------------------------------------------------
-
- Usage: STARTDOS <Rexx CMD file> <optional command.com arguments>
-
- StartDos is an OS/2 program to start virtual DOS mode sessions under OS/2.
- The nature of DOS sessions under OS/2 is controlled by DOS settings, some of
- which can only be set at session startup. StartDos accepts these settings
- via a Rexx command file, then starts a DOS session with those settings.
-
- Examples of some settings that can only be specified at start time:
-
- DOS_DEVICE=<device driver file spec>
- DOS_HIGH=1 ("ON" changed to 1)
- DPMI_MEMORY_LIMIT=8 (integer represents megabytes)
-
- Most settings that require ON accept either ON or 1. Some settings must have a
- 1 instead of ON. For more info on settings, see the settings dialog in the
- Workplace Shell.
-
- To specify DOS settings to StartDos, name a Rexx command file on the
- command line. StartDos looks in the current directory for the Rexx file. If
- not present, then it searches the PATH. StartDos invokes the Rexx
- interpreter, and the command file executes in a special StartDos
- environment. In this environment, the Rexx program can call functions in
- StartDos like AddDosSetting() and StartBackground(). See the complete list
- of callable StartDos functions below. Example Rexx:
-
- /* Rexx command file for StartDos (comment mandatory on first line!) */
- parse arg szCommandComArgs
- if 'STARTDOS' <> address() then do
- say 'Expected STARTDOS environment'
- return 2
- end
- rc = AddDosSetting( 'DPMI_MEMORY_LIMIT=8' )
- rc = AddDosSetting( 'DOS_HIGH=ON' )
- /* override the default and start the session in a PM window */
- rc = StartWindowed()
- return 0
-
- These special functions are available to Rexx programs invoked from StartDos:
-
- AddDosSetting( <setting string> ) /* may be called multiple times */
- StartForeground() /* foreground start is default */
- StartBackground()
- StartFullscreen() /* fullscreen start is the default */
- StartWindowed()
- ExecSynchronous() /* asynchronous start is default */
- SetCommandArgs( <command.com args> ) /* args acceptable to command.com */
- SetSessionTitle( <session title> ) /* title to appear in window list */
-
- When the Rexx program ends with a zero result code, StartDos starts the DOS
- session.
-
- The default exec is asynchronous; i.e., StartDos will end as soon as the
- child DOS session is started. A synchronous exec is one where StartDos waits
- until the child DOS session ends before StartDos itself ends. In this case,
- StartDos will return the same errorlevel as COMMAND.COM. COMMAND.COM in OS/2
- returns the same errorlevel as the DOS program invoked with the /c option.
- Therefore, a synchronous exec and /c option causes StartDos to return with
- the same errorlevel as the DOS program. This is important when invoking DOS
- programs from OS/2 make files.
-
- Other arguments to StartDos are optional. If given, they must make sense to
- the DOS command shell COMMAND.COM. These arguments are passed to the Rexx
- program by StartDos. Example StartDos command lines:
-
- |----- example -----------| |----- explanation --------->
- startdos sets.cmd starts command.com alone
- startdos sets same as above; defaults to sets.cmd
- startdos sets /c procomm /fcis /fcis is an arg to procomm
- startdos sets /c wp /c for call; session exits with wp
- startdos sets /k dir /k for keep; dir and session stays
- (/c and /k are command.com-defined switches)
- startdos sets /c winos2 word starts winos2 and a windows program
-
- COMMAND.COM arguments to StartDos are optional. As of 21SEP93 version of
- StartDos, COMMAND.COM arguments may be set from the Rexx file using
- SetCommandArgs(). Assume there is a DOS program CLEANDSK.EXE and the Rexx
- file is called CLEAN.CMD.
-
- /* clean.cmd */
- parse arg szCommandComArgs
- select
- when 'CMD' = address() then do
- 'STARTDOS clean'
- end
- when 'STARTDOS' = address() then do
- rc = StartBackground()
- rc = ExecSynchronous( )
- rc = SetCommandArgs( "/c cleandsk a:" )
- end
- otherwise do
- say 'Unexpected execution environment'
- return 4
- end
- end
- return 0
-
- Then from an OS/2 prompt, enter
-
- CLEAN
-
- CMD.EXE runs it first and spawns StartDos. Ultimately, StartDos gets the
- COMMAND.COM arguments via the SetCommandArgs() functions. StartDos will wait
- until the DOS program completes.
-
- Concerning error checking: if you specify an incorrect DOS setting, chances
- are the session will start anyway. You may get an error message from OS/2.
- StartDos itself may exit with a failed assertion.
-
- StartDos written by Monte Copeland, IBM Boca Raton.
- StartDos program (C) Copyright IBM Corporation 1993.
-