Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The horse before the cart (SCAN problem)
Message
From
11/10/2006 13:00:11
 
 
To
11/10/2006 12:42:39
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01161244
Message ID:
01161253
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
>This if a very simplified example of a problem I'm having. It's something like the cart before the horse before the cart... The real code is using various IF logic conditions to try and make the stuff inside the SCAN appear in the correct order and for the correct FundType. It doesn't do it very well, and I think there is a simple way, but I can't find it. Any help appreciated. In trying to simplify it I may have made it harder to understand, so let me know if you need more info.
>
>
>
>Cursor: crsDisclaimers
>
>DisclaimerID     DisclaimerText
>
>
>Cursor: crsFunds
>
>FundTypeID     FundName     FundID     DisclaimerID
>
>
>SELECT crsFunds (ORDERed by FundTypeID)
>SCAN
>
>	* Make the results do this:
>	
>	Top Disclaimer (SQL from crsDisclaimers for the FundType)
>
>	DISPLAY individual fund records for the FundTypeID
>
>	Bottom Disclaimer (SQL from crsDisclaimers for the FundType) *
>	Footnotes (SQL from crsDisclaimers for the FundType)
>
>ENDSCAN
>
>
>* These two sections need to only display after the individual records. The problem is by the time I know that the FundTypeID has changed, I'm already on the next record and my SQL (or IF logic) is not referencing the next FundType records.

Something like:
SELECT crsFunds (ORDERed by FundTypeID)
lnFundId = 0 && Some nomber that you are sure FundTypeID can't be
lbFirst  = .t.
SCAN
	* Make the results do this:
        IF m.lnFundId # FundTypeID OR;
           m.lbFirst
           IF NOT m.lbFirst
              Bottom Disclaimer (SQL from crsDisclaimers for the FundType) *
              Footnotes (SQL from crsDisclaimers for the FundType)
           ENDIF
 
	   Top Disclaimer (SQL from crsDisclaimers for the FundType)
           m.lbFirst  = .f. 
           m.lnFundId = FundTypeID
        ENDIF

	DISPLAY individual fund records for the FundTypeID
ENDSCAN
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform