Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF in a SELECT
Message
From
09/03/2000 14:59:26
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00343773
Message ID:
00343809
Views:
21
I understand,but this behaviour caused me some problems, because I had code like : Select field1,iif(field2=0,0,field3/field2) as nCalc from myTable.

I have some ole control (tee chart) in this form, and when i put my ole control visible VFP send to me a messagebox with the text "Floating point division by zero."

But it's ok, I corrected my code with the help of David Stevenson.

Thanks !

>>* 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,
>
>That is not an error. VFP does a test parsing of teh SELECT commadn before it actually runs the command. You are seeing your UDF called for the text and then for the actual processing.
Previous
Reply
Map
View

Click here to load this message in the networking platform