Skip to content
Pete edited this page Jan 28, 2022 · 16 revisions

🔙 Home

  • hb_PathJoin(<cPathAbsolute>, <cPathRelative>) cResultPath
    attempts to, safely, join the given paths to form a unified one.
    If <cPathRelative> is not string the returned value is null string ""
    otherwise,
    returns: <cPathRelative> when it includes a drive letter or starts with a path delimiter (e.g. :\/) or when <cPathAbsolute> is empty or not path or not string;
    otherwise,
    returns: <cPathAbsolute> properly joined with the <cPathRelelative> at the end. Both paths should be ending with path-separators, in order to be joined correctly. (to ensure this, use hb_DirSepAdd() if needed).

  • hb_PathNormalize(<cPath>) cNormalizedPath

  • hb_PathRelativize(<cPathBase>, <cPathTarget>, <lForceRelative>) cRelativizedPath

  • hb_PCodeVer() cPCodeVersion
    compatibility function. please see/use hb_Version( HB_VERSION_PCODE_VER ).

  • hb_PIsByRef( <nParam> ) lIsByRef
    returns .T. if the nParam is passed by reference. nParam is the number indicating the position of a parameter in the parameter list passed to the function where the check is being done.


  • hb_PRead( <nPipeHandle>, <@cBuffer>, [<nBytes>], [<nTimeOut>] ) nBytesRead
    It can be used for unblocking read from pipes, i.e. using handles returned by hb_processOpen() function. <nPipeHandle> is pipe read handle, <cBuffer> is string variable passed by reference with read buffer, <nBytes> is maximum number of bytes which can be read, <nTimeOut> is timeout in milliseconds to wait for data to read;
    this function returns when at least one byte can be read. Returned <nBytesRead> is number of bytes read from the pipe. On error return -1.

  • hb_processClose( <hProcess> , [lGentle] ) lSuccess
    closes an opened process.

  • hb_processOpen( <cCommand>, [ @<cStdIn> ], [ @<cStdOut> ], [ @<cStdErr> ], [ <lDetach> ], [@PID] ) hProcess

  • hb_ProcessRun( <cCommand>, [ <cStdIn> ], [ @<cStdOut> ], [ @<cStdErr> ], [ <lDetach> ] ) nResult
    attempts to execute <cCommand> (i.e. an external application or O/S command) and stores its output to <cStdOut> and <cStdErr> variables (they must be passed by reference).
    It's possible to merge stdout and stderr output by using for 3rd and 4th parameters the same variable, for example: nResult := hb_processRun( cCommand,, @cOutErr, @cOutErr )
    see also: hb_Run()

  • hb_processValue( <hProcess> , [lWait] ) nStatus
    returns the status (exit code? - OS error?) of <hProcess> process.
    [note: on Windows platform, to obtain the status, this function uses internally the WaitForSingleObject function. See also the source-code of the function, that might (possibly) help to get a more accurate idea about the returned value].


  • hb_ProgName() cExeName
    returns the executable program name.

  • hb_ps() OSpathSepator
    returns the character used as path separator; usually backslash \ on Windows, slash / on *nixes.

  • hb_PValue( <nParam> [, <uNewValue> ] ) uValue
    returns the value passed in the <nParam> parameter and optionally assigns a new value to it. It returns the current parameter value (which may not necessarily be the original value passed).

  • hb_PWrite( <nPipeHandle>, <cBuffer>, [<nBytes>], [<nTimeOut>] ) nBytesWritten

TODO: hb_PathNormalize(), hb_PathRelativize()

🔙 Home