Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan - Endscan
Message
From
05/04/2010 04:34:29
 
 
To
05/04/2010 04:23:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01458691
Message ID:
01458697
Views:
48
>>>>>Hi All
>>>>>
>>>>>Can you have nested SCAN - ENDSCAN on different files within a SCAN - ENDSCAN on some other file?
>>>>>
>>>>>Thanks
>>>>
>>>>Sure
>>>
>>>Hi Gregory - thanks for the fast reply :) Just to be 100% clear; each nested SCAN - ENDSCAN, as well as the outside SCAN- ENDSCAN, will know which file it is processing and move the record pointer accodingly without affecting any other SCAN - ENDSCAN file loop?
>>
>>Yes, why not - as long as the nested scan does not scan the alias of the outer scan or moves the pointer of the outer scan by eg seeking
>
>Thanks. Last question; if I move the record myself using, for example, SKIP inside the SCAN - ENDSCAN will the SCAN continue from the record point I moved to or will it revert back to what it had as the record pointer?
>
>UPDATE: Thanks Grgeory - I have run a quick test to determine the answer. It works as expected. Thanks again.


I also had a quick test to confirm what I was thinking. It does not 'revert' as you put it
create cursor outer (pp I )
for i = 1 to 5 
	insert into outer values (m.i)

endfor

create cursor inner (pp I )
for i = 1 to 2 
	insert into inner values (m.i)

endfor


select outer
scan all
	? 'outer', pp
	
	if( empty(mod(pp,2)) )
		skip
	endif
#If .f.	
	select inner
	scan all
		?chr(9), 'inner', pp
	endscan
#endif
endscan
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform