xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_OsPathListSeparator()

Returns the operating specific separator character for a path list.

Syntax

HB_OsPathListSeparator() --> cDDelimiter

Return

The function returns a character used as separator between directories in a path list.

Info

See also:HB_OsNewLine(), HB_OsDriveSeparator(), HB_OsPathDelimiters(), HB_OsPathSeparator()
Category: Environment functions , xHarbour extensions
Source:rtl\philes.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example implements a function that fills an array with all
// directories contained in an environment variable holding a path.

   PROCEDURE Main
      LOCAL aPath := AGetPath( "PATH" )

      ? "SET PATH="
      AEval( aPath, {|c| QOut( c ) } )

      ? "SET INCLUDE="
      aPath := AGetPath( "INCLUDE" )
      AEval( aPath, {|c| QOut( c ) } )
   RETURN


   FUNCTION AGetPath( cEnvVar )
      LOCAL cDelim := HB_OsPathListSeparator()
      LOCAL cPath  := GetEnv( cEnvVar )
      LOCAL aPath  := {}
      LOCAL nStart := 1
      LOCAL nEnd

      DO WHILE ( nEnd := At( cDelim, cPath, nStart ) ) > 0
         AAdd( aPath, SubStr( cPath, nStart, nEnd - nStart ) )
         nStart := nEnd + 1
      ENDDO
   RETURN aPath

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe