Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Behavior of the not equal to operator
Message
 
 
À
12/09/2003 20:43:16
Thomas Ianuzzi
Information Security Consultants, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00828712
Message ID:
00828713
Vues:
13
Tom,

The way FoxPro compares strings is controlled by SET EXACT command. When SET EXACT is OFF (default) the string on the left is compared charcter by character until mismatch is found or the end of the string on the right. So
? "ABC" = "A"    && .T.
? "ABC" = "AB"    && .T.
? "A" = "AB"    && .F.
? "ABC" = ""    && .T.
* <> is opposite to '='
? "ABC" <> ""    && .F.
For exact comparison you can use '==' operator. For more details see help on the SET EXACT command.

>In the click event of a button in a form I have the following code. It started out performing a task but I have simplified it for debugging.
>
>
>suspend
>if nnn <> ndrop && both are string variables
> Messagebox("it worked")
>endif
>
>At the moment of suspension, The value of nnn is 5035S and the value of ndrop is ""
>
>The messagebox never appears, it is skipped over and later code is executed.
>
>If I change the IF statement to if a=a it works fine.
>
>Does anyone have and insight into my problem
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform