Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One SCAN FOR statement with two different criteria.
Message
From
08/10/2000 17:28:09
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00426667
Message ID:
00426668
Views:
19
Elgin,
cScanCriteria = [CustId = ] + STR(CustId)
SCAN FOR &cScanCriteria
    *!* Do stuff here
ENDSCAN
>I have a stored procedure that is used to create a report cursor. In this procedure is a SCAN FOR.... END SCAN that has alot of code in between for selecting data from my 5 child tables that I do not want to repeat if possible. However, I would like to give the user a few options for selecting the Parent records that will be included in the report.
>
>The statment currently looks like this for running the report for the currently selected Parent record:
>
>SELECT Namplatv
>SCAN FOR Custid = gcCustid AND Upsino = gcUpsino
>
> Alot of Code for Building reportcursor.
>
>ENDSCAN
>
>I would like to give them the option to select All records for the current CUSTID like:
>
>SELECT Nameplatv
>SCAN FOR Custid = gcCustid
> Alot of Code..
>ENDSCAN
>
>Or even a Range of records specified. This Stored procedure is launched from a button on a form called "ReportSelect" that I use to set which of two report forms to be used.
>
>I don't know how to change my "SCAN FOR" criteria according to what they select. I've tried using variables in place of the criteria and as expected did not work.
>
>Not sure if I'm approaching this correctly. My main goal is to not have to repeat all that code within the SCAN command.
>
>Thanks a million.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform