[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-----------+##############################################################
#+-| PATH_OF() |---------------------------------------------------+##########
#| +-----------+ Searches through all paths described within paths |##########
#+-----------------------------------------------------------------+##########
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE system.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |-----------------------------------------------+################
#| PROCEDURE path_of PROTOTYPE |################
#| PARAMETERS CONST CHAR paths, CONST CHAR filename |################
#+-----------------------------------------------------------+################
##############################################################################
##############################################################################
#########+---| Description |-----------------------------------------+########
#########| This function searches through all paths described within |########
#########| paths for file filename. Path strings must be delineated |########
#########| with paths by the semicoln, ;. If the filename can not |########
#########| be found, a NULL string is returned. |########
#########+-----------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Get the path of an executable file. |#########
#########| |#########
#########| z = path_of("c:\tools;c:\dos;c:\bin","force.exe") |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * A "which()" function. Returns which file will |#########
#########| * be executed. For example, there might be |#########
#########| * several x.exe files on a system. If a user |#########
#########| * types: x <return> at the DOS prompt, which |#########
#########| * x.exe will be executed? |#########
#########| |#########
#########| FUNCTION CHAR which |#########
#########| PARAMETERS CONST CHAR f |#########
#########| |#########
#########| IF exist( f ) && if in current dir |#########
#########| RETURN f |#########
#########| ENDIF |#########
#########| |#########
#########| RETURN path_of( getenv("PATH"), f ) |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
curdir()
curdrive()
SET DEFAULT TO
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson