Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One or more IF statements?
Message
From
30/07/2008 13:52:13
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
30/07/2008 12:22:06
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:
01335308
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Hi Beth,

The OR in the statement causes reccount() to always be evaluated and the error is because the cursor does not exist. You either need to break up statement into two parts or check to make sure the cursor exists.
IF (VARTYPE(poGraph.cursor2) = "U" AND lnbutton = 5) ;
      OR (USED(poGraph.cursor2) AND RECCOUNT(poGraph.cursor2) = 0)
>Hi All,
>
>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
Reply
Map
View

Click here to load this message in the networking platform