Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> drvdirdepget()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DrvDirDepGet()
------------------------------------------------------------------------------
 Purpose:
 Get relative directory depth of a fake root.

 Syntax:
 iDepth = DrvDirDepGet( lpszDrive )

 Parameters:
 lpszDrive The drive letter.

 Returns:
 A numeric value (signed short int).

 Description:
 DrvDirDepGet() returns the relative depth of the directory mapped to
 drive lpszDrive from the root directory. This function is useful for
 finding fake root directories. lpszDrive is a valid drive letter from
 A to Z including special drive letters [,\,],, _ & '.

 If drive lpszDrive is not mapped to a fake root, or not mapped at all,
 DrvDirDepGet() returns 255. If the drive lpszDrive is mapped to a fake
 root, DrvDirDepGet() returns the number of directories from the fake root
 to which the drive letter is currently mapped.

 Returns NOVERRINT if an error occurs.

 Example:
 // To find the DOS path for a fake root mapping of drive "M":
 lpszPath = DrvPthGet("M")
 lpszPath = substr( lpszPath, at(":",lpszPath ) )
 iDepth = DrvDirDepGet("M")
 if( iDepth = 255 )
    ? "DOS Path is", "M" + lpszPath
 elseif ( iDepth = 0 )
    ? "DOS Path is", "M:\"
 else
    lpszTPath = lpszPath
    for n = 1 to iDepth
       iOffset = rat( "\", lpszPath" ) - 1
       lpszTPath = substr( lpszTPath, 1, iOffset )
    next
    ? "DOS Path is", "M:" + substr( lpszPath, iOffset )
 endif

 Notes:
 This function only works on Version 3.x workstation shells.

See Also: DrvRootMap() DrvPthGet()

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