home *** CD-ROM | disk | FTP | other *** search
- GetBootDrive - REXX
- Copyright (C) 1993 Bruce E. Högman. All Rights Reserved.
- This program is dedicated to the Public Domain by the author.
-
- Function: GetBootDrive returns the letter of the drive used to
- boot the system. It uses DosQuerySysInfo to return the boot drive
- number from OS/2.
-
- The source file, GBOOTDRV.C, illustrates the use of the
- DosQuerySysInfo control program API function to return information
- from the operating system. The boot drive information is most needed
- to design fool-proof install REXX programs. GBOOTDRV is a simple
- REXX external function to provide this information for REXX programs.
- Use the source program as a template to design your own REXX external
- functions.
-
- Sample REXX to show the boot drive:
-
- /* REXX */
- if 0 < RxFuncQuery('SysLoadFuncs') THEN DO;
- Call rxfuncadd 'SysLoadFuncs','REXXUTIL','SysLoadFuncs';
- Call SysLoadFuncs;
- END;
- Call rxfuncadd 'GetBootDrive','GBOOTDRV','GetBootDrive';
- BootDrive=GetBootDrive();
- say 'Boot Drive='BootDrive;
- Call RxFuncDrop 'GetBootDrive';
- exit;
-
-