>>The following line is not working as expected:
>>
>>
>>Dim lcImpDate As String = _
IIf(IsStringBlank(Trim(Request.Form("txtImpDate").Replace("/",""))),"", _
FormatDateSubmit(Request.Form("txtImpDate")))
>>
>>
>>IsStringBlank() and FormatDateSubmit() are other functions in my class. The IsStringBlank() IS returning true, but the FormatDateSubmit() function is still being called even though it is in the "false" part of the IIf. Any ideas what I'm missing here?
>>
>>Thanks,
>>KP
>
>Kevin,
>
>That behavior is normal for IIf. You have to use an If..Then with AndAlso or OrElse to get short-circuit evaluation.
Keith,
While it might be normal for VB it sounds to be a bug to me. In documentation it says it's a counterpart of "?" operator of C. ? operator's behavior is absolutely is not like that. Both C and VFP (iif()) correctly only call the relevant part.
Cetin