Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - drivestr() return list of existing drives http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 drivestr()          Return list of existing drives
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func char(26) drivestr extern
   param value uint uDrives

 Arguments
   uDrives is a constant specifying the kind of drive list to be
   returned. Possible parameter values are defined in file.hdr as following:

   ---------------------------------------------------
   Macro              Value         Meaning
   ---------------------------------------------------
   DS_ALL             0             List all drives
   DS_FLOPPY          1             List floppy drives
   DS_HARD            2             List hard drives
   ---------------------------------------------------

 Return
   A character string consisting of uppercase letters for available drives.

 Description
   The drivestr() function returns the list of available disk drives in
   character string format.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc DriveDisp static
   param const char cText, value uint uDrives
   // Display available drives, considering critical errors
   vardef
      char( 26 ) cDrives
   enddef
   ? cText                            // display text
   cDrives := drivestr( uDrives )     // get drive string
   if __errcritical.code ==  0 .or. ; // if no critical error or...
      __errcritical.code == 21        // ...drive is not ready
      ?? cDrives                      // display drive list
      __errcritical.code := 0         // reset error code
   else
      ? "Critical error", istr( __errcritical.code )
   endif
   endproc
   
   proc Test_drivestr
   DriveDisp( "Floppy drives: ", DS_FLOPPY )
   DriveDisp( "Hard   drives: ", DS_HARD )
   DriveDisp( "All    drives: ", DS_ALL )
   endproc

   proc main
   Test_drivestr()
   endproc

See Also: curdrive()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson