Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF in a SELECT
Message
From
09/03/2000 13:57:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00343773
Message ID:
00343783
Views:
23
I understand that it not fires with the wait waindow and it is o.k.

But, what I don't understand it's WHY it is execute in the SELECT ?

It's not supposed to be execute !

>The wait window is evaluating correctly. The Value is 2 to if fires the first choice. if you want to fire the test fuction change the 2 to a 5 and it will fire.
>
>Ron
>
>
>>I have a problem with the command IIF() in a select.
>>
>>--> IIF(lExpression, eExpression1, eExpression2)
>>
>>Even if the lExpression is evaluate to .t., the code in the eExpression2 is executed in a select, but not in a command like wait window ?
>>Why ?
>>
>>-- I always thought that it was not supposed to be execute !
>>
>>Try this and you will see the problem :
>>
>>create cursor curTest (cValue integer)
>>select curTest
>>insert into curTest values(2)
>>
>>* This code will not execute the function test
>>wait window iif(cValue=2,"it will not execute the function",test()+"it will execute it")
>>
>>* This code will execute the function test """ 2 TIMES """????
>>select iif(cValue=2,"it will not execute the function",test()+"it will execute it");
>> from curTest
>>
>>close table all
>>
>>function test()
>> = Messagebox("function test")
>>return ""
>>
>>Did somebody know how to correct that error ?
>>Thanks in advance !!
>>
>>Stef
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform