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> drvdirdepthget()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DrvDirDepthGet()
------------------------------------------------------------------------------
 Purpose:
 Get relative directory depth of a fake root.

 Syntax:
 iDepth = DrvDirDepthGet( lpszDrive )

 Parameters:
 lpszDrive The drive letter.

 Returns:
 A numeric value (signed short int).

 The CA-Clipper name for this function is:
 DrvDirDepGet()

 Description:
 DrvDirDepthGet() 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,
 DrvDirDepthGet() returns 255. If the drive lpszDrive is mapped to a fake
 root, DrvDirDepthGet() 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 = DrvPathGet("M")
 lpszPath = substr( lpszPath, at(":",lpszPath ) )
 iDepth = DrvDirDepthGet("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() DrvPathGet()

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