Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatically detect if indexes are present and delete t
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00570924
Message ID:
00570985
Vues:
19
>>Here's a corrected version
lcTable = "mytable"
>>lcPath = "C:\mypath\"
>>
>>lnFH = FOPEN(lcPath + lcTable + ".dbf", 12)
>>
>>* Check if there is structural CDX
>>= FSEEK(lnFH,28)
>>
>>lnByte28 = ASC(FREAD(lnFH,1))
>>lnCDXStr = BITAND(lnByte28, 1)
>>
>>IF lnCDXStr = 1    && there is CDX
>>	IF FILE(lcPath + lcTable + ".cdx")
>>		ERASE (lcPath + lcTable + ".cdx")
>>	ENDIF
>>        = FSEEK(lnFH,28)
>>        = FWRITE(lnFH, Chr( BITAND(lnByte28, 0xFE) ))
>>ENDIF
>>
>>= FCLOSE(lnFH)
>>
Sorry, I got distracted by something and sent message before it was ready.
>
>Sorry for interfering... I guess, you wanted to update by yourself...

No problem :). I just copied a code from my test program. I'm pretty sure that code should work but you'll have to add error checking.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform