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.
CLOSE ALL
lcSafe=SET("safe")
SET safe off
messagebox("Please select the table you want to extract files from.")
lcTargetTable=FULLPATH(GETFILE([dbf]))
lcFilename = INPUTBOX("Type in the name of the field with your file names.")
lcGeneralFieldname = INPUTBOX("Type in the name of the general field.")
messagebox("Please select an example of the file type you want to extract e.g. a Word file")
lcTestStr=LEFT(FILETOSTR(GETFILE()),10)
SET DEFAULT TO JUSTPATH(lcTargetTable)
USE (lcTargetTable)
SCAN
lcOutputNameAndPath=SYS(5)+SYS(2003)+[\]+&lcFilename
COPY FIELD (lcGeneralFieldname),&lcFilename TO MyTempFile NEXT 1
lcFile=FILETOSTR("MyTempFile.FPT")
lcFile=RIGHT(lcFile,LEN(lcFile)-(ATC(lcTestStr,lcFile)-1))
IF ATC(lcTestStr,lcFile)<1000 &&otherwise assume it's a different file type
STRTOFILE(lcFile,lcOutputNameAndPath)
ENDIF
ENDSCAN
DROP TABLE MyTempFile
SET SAFETY &lcSafe