PROTECTED PROCEDURE CheckValidPath lparameter tcPath local lcPath, lcFile, lnHandle, lnRetVal lcPath = addbs(tcPath) if not CreatePath(lcPath) return "????" endif lcFile = SUBSTR(SYS(2015), 3, 10) + ".txt" lnHandle = fcreate(lcPath + lcFile) && test to see if files can be written to destination if lnHandle < 0 return "" endif lnRetVal = fclose(lnHandle) erase (lcPath + lcFile) return lcPath ENDPROC PROTECTED PROCEDURE CreatePath lparameter tcPath local lnRetVal, laFiles[1], lcPath lcPath = Left(tcPath, Len(tcPath)-1) lnRetVal = adir(laFiles, lcPath, "D") if lnRetVal = 0 md (tcPath) endif lnRetVal = adir(laFiles, lcPath, "D") return (lnRetVal > 0) ENDPROC