Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SCAN...ENDSCAN
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00153935
Message ID:
00153944
Views:
18
>I have a cursor called cpayment with 3 records. The cpay_flag is .t. and cpay_schdate has a date in all 3 records. When I run the following code it only loops through one record, not all 3. If I comment out the replace cpay_schdate with {} and replace cpay_flag with .f. the SCAN will loop through all records. Now I know whats causing the problem but I don't understand why.
>
>
>select cpayment
>SCAN FOR ((cpay_flag = .t.) and (!empty(cpay_schdate)))
>	replace cpay_schdate with {}
>	replace cpay_flag with .f.
>	if !cpay_update = 'D' then
>		replace cpay_update with "C"
>	endif
>	replace cpay_amt with 0.00
>ENDSCAN
>
Is there an order or filter set here? My guess is that an order/filter is set and when you change the contents of the fields, the record is then placed outside of the index/filter group and, effectively, past the end of the scan range.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform