Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One or more IF statements?
Message
From
30/07/2008 13:13:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01335285
Message ID:
01335298
Views:
13
Hi Sergey,
I don't know if I am explaining it correctly. I only want to go into the if part of the if - else statement, if the poGraph.cursor2 is not populated and the report is 5, or if the report is 5 and the record count for the cursor2 is zero. I don't want to go into the If part if the report is not 5, it should go to the else part for any report other then 5. The problem seems to be that it gets to the reccount(poGraph.cursor2) = 0 and errors, because poGraph.cursor2 is not a number.

going to try some things.


>Hi Beth,
>
>Maybe I'm missing something, but isn't poGraph.cursor2 populated only when lnButton = 5, which makes check for the button redundand? Also, the second part of conditions will be evaluated only when poGraph.cursor2 is not NULL.
>Simple test
>
>poGraph = NEWOBJECT("Empty")
>ADDPROPERTY(poGraph, "cursor2", NULL)
>? (ISNULL(poGraph.cursor2) OR RECCOUNT(poGraph.cursor2) = 0)  && .T.
>*
>poGraph.cursor2 = .F.
>? (ISNULL(poGraph.cursor2) OR RECCOUNT(poGraph.cursor2) = 0)  && Error
>
>
>
>> That still does not work. I still get error 17, because it is looking at RECCOUNT(poGraph.cursor2) = 0.
>>I have to look at three things for this set of statements within the IF to work:
>>1. poGraph.cursor2 needs to be not set to a cursor name.
>>2. lnButton needs to be 5 - they picked the 2 graph report
>>3. if lnButton is 5, is there any records in the cursor.
>>
>>
>>>Try
>>>IF (ISNULL(poGraph.cursor2) OR RECCOUNT(poGraph.cursor2) = 0)
>>>
>>>BTW, VARTYPE() returns 'X' for NULL value.
>>>
>>>
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform