Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One or more IF statements?
Message
From
30/07/2008 12:48:47
 
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:
01335292
Views:
15
Hi Sergey,
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.
>
>
>>
>>I have a form where I show graphs. I have 3 buttons on this form. One is for collecting the data, second if for generating the report for printing, and the third is for, if there is a 2nd graph for the report (there is only one report with 2 graphs at the moment), toggling between the two graphs.
>>
>>In the second button, I have a IF statement, where I am trying to determine weather there is not a 2nd graph and was the 2nd graph report selected or if there is, does it have any records in it. My current statement looks like this:
>>
>>
>>IF (VARTYPE(poGraph.cursor2) = "U" AND lnbutton = 5) ;
>>      OR RECCOUNT(poGraph.cursor2) = 0
>>
>>
>>I get error 17 – table number is invalid.
>>
>>PoGraph is an empty class I create. In the first button code, I add properties for cursor1 and cursor2, cursor2 is set to .NULL. (it was .F. before) if the report is not the 2 graph report, otherwise it is set to the cursorname.
>>
>>Lnbutton holds the number of the report from the report table. 5 is the only report with 2 graphs, all the others have only one graph with them.
>>
>>Do I need to break this into 2 IF statements, or more, or can it be done as one?
>>
>>TIA
>>Beth
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform