Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with SCAN...ENDSCAN
Message
From
03/11/1998 10:52:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00153935
Message ID:
00153942
Views:
23
Paul --- Is there an active index and is it based on those fields? If so, you could be dynamically changing the order of the SCAN, causing unexpected results.


>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
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform