xHarbour Reference Documentation > Function Reference |
Returns the operating specific separator character for a path list.
HB_OsPathListSeparator() --> cDDelimiter
The function returns a character used as separator between directories in a path list.
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 |
// 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
http://www.xHarbour.com