Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird Problem with Evaluating
Message
 
 
À
27/10/2004 16:19:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Divers
Thread ID:
00955005
Message ID:
00955025
Vues:
21
>My co-worker came to me with a weird problem. He has some code that should blow up, but is running and I can not explain it.
>
>He has a Department field in table Depts. In this case, Depts.Department="A"
>
>He has a field that indicates if a department should print or not. In this case, it's NOPRINT and NOPRINT = .F.
>
>His statement is in a loop and it looks like this:
>
>IF ALLTRIM(depts.Department) == NOPRINT
> SKIP
>ENDIF
>
>If you are in the debugger, the program breezes right past the IF and it evaluates to TRUE, effectively skipping the record.
>
>"A"==.F. should give an error.
>
>In the watch window, the same expression - ALLTRIM(depts.Department) == NOPRINT - shows up as an error. There isn't any ON ERROR set either. The same expression in the command window returns an error.
>
>Is there any reason why the program would evaluate the illegal expression to TRUE?
>
>Thanks,
>Tim

Could it be that you have NOPRINT defined as constant in .h file? Though field should still have precedance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform