home *** CD-ROM | disk | FTP | other *** search
- FUNCTION FM_LOCAT
- if not _windows
- **** PRE WINDOWS CODE
- =pathset()
-
- * returns directory of foxmasters
- public fmhome, fm_base
- fmhome = ""
- IF FILE(SYS(2004)+'fm\'+"FM_setup.DBF")
- =SB_SELEC(SYS(2004)+'fm\',"FM_setup")
-
- GO TOP
- fm_base = sys(2004)+"FM\"
- fmhome = TRIM(FM_setup.location)
- endif
- if empty(fmhome)
-
- fmhome = sys(2004)+"FM"
-
- endif
- * SEE IF HOMEDIR IS IN THE FOXPRO PATH STATEMENT
- else
- *************************
- *** Windows Code
- * Sample program to output to comm port
- * uses foxtools library for generic DLL access
-
- set library to sys(2004)+"foxtools.fll" additive
-
- getprofstr = RegFn("GetProfileString", "CCC@CI", "I")
- section = "FoxMasters"
- item = "FMPATH"
- default = "C:\FM"
- fm_home = space(80)
- maxsize = 80
-
- * returns value by reference
- ln =CallFn(getprofstr,section,item,default,@fm_home,maxsize)
-
- * get rid of extra spaces and asc 0 at end of path string
- fm_home = left(alltrim(fm_home),len(alltrim(fm_home))-1)
-
-
- IF FILE(fm_home+'\'+"FM_setup.DBF")
- =SB_SELEC(fm_home+'\',"FM_setup")
-
- GO TOP
- fm_base =fm_home
- fmhome = TRIM(fm_home)
- endif
-
- * release library sys(2004)+"foxtools.fll"
-
-
-
- endif
- =pathchec(fm_home)
-
- RETURN (fm_home)
-
- FUNCTION pathchec
- PARAMETERS path2check
- private path2check, oldpath, newpath
- oldpath = set("path")
- if not upper(path2check) $ oldpath
- newpath = path2check+";"+oldpath
- set path to (newpath)
- endif
- return .t.
-