>I saw this AndAlso usage in such a line:
>
>
> If (requestValidationSource__1 = RequestValidationSource.QueryString) AndAlso (collectionKey = "data") Then
>
>
>What is the difference with And?
(1) And -
http://msdn.microsoft.com/en-us/library/sdbcfyzh.aspxEvaluatates all expressions, you can use side-effects
If ( ( x > 1) And MyFunction()) )
MyFunction() will be called regardless of whether x > 1 or not
(2) AndAlso -
http://msdn.microsoft.com/en-us/library/cb8x3kfz.aspx Is said to use short-circuiting and stops evaluating as soon as it finds that it has processed sufficient parts of the expression to know the result
If ( ( x > 1) AndAlso MyFunction()) )
if x less or equal to 1, then MyFunction() will not be called
Gregory