Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*... the "D" is the directory attribute
nHowMany = ADIR(aList, "C:\TEMP", "D")
IF nHowMany = 0
WAIT WINDOW "Directory doesn't exist" TIMEOUT 2
ENDIF
* Usage
IF NOT GOTDIR("C:\RickTemp")
** create it or warn missing
ENDIF
*.......
FUNCTION GOTDIR
PARAMETERS zcpath
PRIVATE lcsvcurr, lcbasepath, lcdir, llret_val, lcsvonerr
llret_val = .T.
lcsvonerr = ON('ERROR')
ON ERROR DO lhanderr WITH ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
lcbasepath = ADDBS(zcpath)
lcdir = SUBSTR(lcbasepath, RAT('\', lcbasepath, 2))
lcbasepath = LEFT(lcbasepath, LEN(lcbasepath)-LEN(lcdir)+1)
lcdir = SUBSTR(lcdir, 2, LEN(lcdir)-2)
lcsvcurr = sys(5)+SYS(2003)
SET DEFAULT TO (lcbasepath)
IF llret_val
lnlength = adir(myjunk,"","D")
SET DEFAULT TO (lcsvcurr)
lnfound=ASCAN(myjunk, lcdir)
RELEASE myjunk
llret_val = (lnfound > 0)
ENDIF
ON ERROR &lcsvonerr
RETURN llret_val
*!*****************************************************************************
*!
*! Procedure: lhandler
*!
*!*****************************************************************************
PROCEDURE lhanderr
PARAMETERS zerror, zcmess, zcmess1, zprog, znlineno
PRIVATE zerror, zcmess, zcmess1, zprog, znlineno
llret_val = .F. && not valid
RETURN
*
* ADDBS - Add a backslash unless there is one already there.
*
*!*****************************************************************************
*!
*! Function: ADDBS
*!
*!*****************************************************************************
FUNCTION addbs
* Add a backslash to a path name, if there isn't already one there and uppercase
PARAMETER m.pathname
PRIVATE ALL
m.pathname = ALLTRIM(UPPER(m.pathname))
IF !(RIGHT(m.pathname,1) $ '\:') AND !EMPTY(m.pathname)
m.pathname = m.pathname + '\'
ENDIF
RETURN m.pathname