Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can VFP determine MS Project version on a file
Message
 
À
12/02/2002 09:12:19
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00618395
Message ID:
00619374
Vues:
21
>>The code above needs to be modified to:
>>
>>
>>nGFH = fopen('C:\Temp\Project2.mpp')
>>lcCheck=UPPER(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,i)
>>  if "8.0" $ substr(lcCheck,nFoundAt,21)
>>    lFound=.t.
>>    EXIT
>>  ENDIF
>>ENDFOR
>>return lFound
>>ENDIF
>>
>
>Ooooops, you're right about the second parameter of substr(). Upper in the second line is not needed, because atc() is case insensitive.
>
>So did this work for you?


Yes it worked fine and the speed over FILETOSTR was very good. The only problem I have about the whole solution is our assumption, which is currently valid, that the phrase MICROSOFT PROJECT is in the first 6000 characters and will always be followed by the version number. If MS changes this in the future then I would not know until my users complained that their input was being rejected. And I dont like to hear from user complaints. But that asided I will inform the money boys of my findings and how best to implement it. The pros and cons and then let them decide if it should be done.

Thanks for the help
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform