Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Utility to detect corrupted CDX ?
Message
De
02/09/1998 11:12:45
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/09/1998 10:57:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00132341
Message ID:
00132386
Vues:
17
>Cetin,
>
>We have traced through the code and it really was a corruption error.
>
>After the seek, the record pointer was not positioned where it should.
>
>After reindexing, the system ran correctly.
>
>The core problem here is that the application is used as a main tool in the month-end processing of my client and the corruption is detected after the fact.
>
>My code to check for corruption is really simple, I will give you a generic example
>since I had to put this type of code in multiple areas of the application:
>
>Original code:
>
> select myArea
> scan for (...)
> select myOtherArea
> seek myArea.myField
> if found()
> (do something...)
> else
> (do something else)
> endif
> endscan
>
>New Code:
>
> select myArea
> scan for (...)
> select myOtherArea
> seek myArea.myField
> if found()
> if myOtherArea.myField <> myArea.myField
> (corruption detected here!!!)
> endif
> (do something...)
> else
> (do something else)
> endif
> endscan
>
>Obviously, this is not the best solution since I cannot detect corruption when the seek is not successful and should be.
>
>Thanks !
>
>Pascal
Pascal,
Would you pls run this one. Maybe some clue it might not be a corruption.
select myArea
? fsize("myField","myArea"),fsize("myField","myOtherArea"), ;
  set("near"), set("exact")
scan for (...)
   if seek(myArea.myField,"myOtherArea","myOtherAreaSeekTag")
      if myOtherArea.myField <> myArea.myField
         wait window myOtherArea.myField+;
                       str(len(myOtherArea.myField))+chr(13)+;
                      myArea.myField+;
                       str(len(myArea.myField))
      endif
*        (do something...)
     else
*        (do something else)
     endif
endscan
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform