Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IF Statement Doesn't Seem to be Working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00123956
Message ID:
00124384
Vues:
26
>>No problem! How about on your pc contributors? Try it and see...
>
>Jeff,
>
>because it wokrs on your machine does not discount the fact that numerics are converted from a character string in the dbf to an binary number in memory. That conversion can cuase a number that looks and acts like 0 to really be 0.00000001 and using the equal sign will say they aren't the same value.
>
>This can happen for a variety of reasons. The solution to prevent it form ever biting you is to avoid the = operator for comparing numbers especially wehn one is a field in a dbf and the other is in memory. In prior version there was bug (which has been fixed) that cause an index on a numeric field to fail on a seek for a value that for purposes was in the table.
>
>In the example situatio in this thread the solution sits in comparing for a range of values that would be considered 0. If the numeric field has 2 decimals then;
>
>IF Field < 0.01
>
>If it might be negative;
>
>IF Field < 0.01 and Field > -0.01
>
>These IF's side step any binary rounding problem.

Yes, but recalling the original thread, it says 'Even if the fields Late, Absent, & Early contain zeros (0.00)...', thus, assuring us that the physical value sitting in the disk is really 0.00.

Could numeric field that has 2 decimals can physically contain 0.00000001? Just asking...
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform