Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with IIF
Message
 
To
15/03/2001 10:28:26
David Brunelle
Université de Sherbrooke
Sherbrooke, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00485358
Message ID:
00485365
Views:
11
>Here is the situation. I want to assign a value to a variable depending of whether or not a certain check box is checked. Normally, I would have used this statement:
>
>IIF (thisform.chkcompleted.value = 1,llcompleted = .T.,llcompleted = .F.)
>
>However, for some unknown reason, it seems that the statement always return false, even when the checkbox is checked. So I had to use this instead
>
>IF Thisform.chkcompleted.value = 1
> llCompleted = .T.
>ELSE
> llCompleted = .F.
>ENDIF
>
>By using this, it works fine, but I just wonder if there is anything I didn't do correctly??
>Just a small question also, something in this place we see pale blue rectangles with code in it. How do you do that?
>
>David
>
>It is said that we learn by our mistake. Boy, I never thoug I could learn that much!!!

David,

You don't even need to bother with IIF() or the block IF...ELSE...ENDIF. Instead use:
llCompleted = (Thisform.chkcompleted.value = 1)
It's faster and there's less code to maintain.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform