Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : RLIB.ZIP
Filename : RL_PATHT.PRG

 
Output of file : RL_PATHT.PRG contained in archive : RLIB.ZIP
* Function: PATHTO
* Author..: Richard Low
* Syntax..: PATHTO(exp) Where exp is name of file to find path to.
* Usage...: To find the DOS path pointing to a file.
* Returns.: DOS path pointing to filename specified by exp, or a NULL
* string if the file was not found in any of the paths.
*

FUNCTION PATHTO
PARAMETER p_filename
PRIVATE f_dospath, f_path

f_dospath = GETE('PATH') && get dos's path from environment (in EXTEND.LIB)
DO WHILE LEN(TRIM(f_dospath)) > 0 && parse for path to help files

IF ';' $ f_dospath && if a semicolon is found in path
f_path = TRIM(SUBSTR(f_dospath,1,AT(';',f_dospath)-1)) && parse each section of the path
ELSE && otherwise
f_path = TRIM(f_dospath) && only one path in the path
ENDIF

IF FILE( f_path + '\' + p_filename ) && found it
RETURN (f_path + '\')
ENDIF

IF ';' $ f_dospath
f_dospath = TRIM(SUBSTR(f_dospath,AT(';',f_dospath))) && snip off beginning of path before semicolon
IF LEN(f_dospath) = 1 && only a semicolon left
EXIT && quit looking
ENDIF && otherwise
f_dospath = SUBSTR(f_dospath,2) && snip off the leading semicolon
ELSE
EXIT
ENDIF

ENDDO
RETURN ('')


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : RLIB.ZIP
Filename : RL_PATHT.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/