Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IF evaluates all expressions
Message
 
À
14/12/2007 14:48:51
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01275930
Message ID:
01275973
Vues:
12
Now I can do it too. Thanks.


>BTW, I use ANDALSO and ORELSE exclusively now, because that is the way I would expect an IF statement to work.
>
>>Thank you !
>>
>>>VB.NET by default does not short circuit.
>>>
>>>You need to use ANDALSO to short circuit AND conditions
>>>You need to use ORELSE to short circuit OR statements.
>>>
>>>If x = 1 ANDALSO y = 2
>>>
>>>If z = 1 ORELSE y = 10
>>>>In VFP when an if statement is processed, the processing stops when the if condition is satisfied like this:
>>>>
>>>>if .t. and (1=2) and (2=2)
>>>>
>>>>
>>>>The processing would stop at (1=2). Whereas in VB.Net all expressions are evaluated which could be awkward in some situations like:
>>>>
>>>>if Dataset.tables.count > and Dataset.Tables(0).rows.count > 0
>>>>
>>>>
>>>>Is there any language setting which alters this evaluation technique?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform