>lcheck = FILETOSTR('C:\Temp\Project2.mpp') >llcontinue = .F. >FOR i = 1 TO 6000 > IF UPPER(SUBSTR(lcheck,i,17)) = 'MICROSOFT PROJECT' > lcFound = SUBSTR(lcheck,i,21) > EXIT > ENDIF >ENDFOR > >IF NOT EMPTY(lcFound) > RETURN(lcFound) >ELSE > RETURN('Unknown') >ENDIF >The probable reason Larry was asking about performance is the size of the project, and the For/Next loop. The size can be neglected, if you use just the first 6000 bytes, and the speed will improve if you use no loop:
nGFH = fopen('C:\Temp\Project2.mpp') lcCheck=fread(nGFH, 6000) fclose(nGFH) lFound = .F. #define C_MSP 'MICROSOFT PROJECT' FOR i = 1 TO occurs(c_msp, lcCheck) nFoundAt=atc(c_msp, lcCheck) if "8.0" $ substr(lcCheck,i,21) lFound=.t. EXIT ENDIF ENDFOR return lFound ENDIFThis should be faster.