Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird Problem with Evaluating
Message
De
27/10/2004 16:23:50
 
 
À
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:
00955010
Vues:
23
NOPRINT can not = .F. (you'd get an error), but if it's an empty string (""), the equation would evaluate to .T.


>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
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform