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 - curpath() return current path http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 curpath()           Return current path
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func char curpath extern
   param value uint uDrive

 Arguments
   uDrive is the number of the drive to access (0: current, 1: A,
   2: B, etc. )

 Return
   Current path on the selected drive as character string.

 Description
   The curpath() function returns the current path on the selected drive
   as a character string.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_curpath
   // List current path for all valid drive letters
   vardef
      uint nLetter
      uint n
      uint nDrives
      uint nCurDrive
      char cPath
   enddef
   nCurDrive := curdrive()           // save current drive
   nLetter := 0
   nDrives := 0
   for n := 'A' to 'Z'               // test all drive characters
      __errcritical.code := 0
      selectdrive( nLetter )         // attempt to switch to a drive
      if nLetter == curdrive()       // if successful
         cPath := curpath( 0 )       // get path for this drive
         if __errcritical.code == 0  // if no access error occurred
            ? cPath                  // show path
         endif
      endif
      nLetter++                      // next drive
   next
   selectdrive( nCurDrive )          // restore original drive
   endproc

   proc main
   Test_curpath()
   endproc

See Also: curdir() curdrive()

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