Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Clarification of the ! or .NOT. operators
Message
De
16/04/2003 03:50:48
Liam O'Hagan
O'Hagan Programming Ltd
Irlande
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00778163
Message ID:
00778216
Vues:
45
Hi Elgin,

Wrap the entire condition in a single NOT, eg
IF !(("PCB" $ UPPER(fluid)) OR ("PYRANOL" $ UPPER(fluid)) OR ("WECOSOL" $ UPPER(fluid)))
  Do Case stuff
Else
  Do other stuff
Endif
Regards,

Liam






>I am trying to figure out why the second IF statement is not working correctly. In my code the field tmpName.liquid contains "PCB "
>
>If tmpName.liquid contains any of the strings "PCB", "Pyranol", or "Wecosol" I want it to execute the ELSE condition. But no matter what I try it always ends up doing the first DO CASE statement. When I watch the statement !("PCB" $ UPPER(fluid)) in the debugger it shows .F. once I get to the REPLACE statement. Why does it still step to the next line - DO CASE, instead of going to the ELSE condition. I just don't get it.
>
>
>IF !EMPTY(tmpLiquid.h20) && Evaluate only if record has a KF Analysis.
>   lcH20 = ALLTRIM(tmpLiquid.h20)
>   REPLACE fluid WITH ALLTRIM(tmpName.liquid)
>      IF !("PCB" $ UPPER(fluid)) ;
>        OR !("PYRANOL" $ UPPER(fluid)) ;
>        OR !("WECOSOL" $ UPPER(fluid))
>          DO CASE
>	    CASE 1
>               Do something
>            CASE 2
>               Do something
>            OTHERWISE
>               Do something else
>           ENDCASE
>      ELSE
>
>          Do other stuff
>
>      ENDIF
>ENDIF
>
>
>Thank you for your help. I'm at wits end.
Liam O'Hagan
MCP VFP Desktop Apps
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform