Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPD25: SCAN WHILE fails SCAN FOR doesn't
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00614777
Message ID:
00616424
Views:
33
Hi

Thanks that is a different approach and may work well in an Electricity failure.

>The easiest way I can think of is to add a logical field that you set as .T. (True) if the record is to be deleted. When you are running the program just set that field to .T. then at the end do a DELETE FOR.
>
>HTH,
>Arriyel
>
>>Hi Arriyel
>>
>>Thanks for you response but I cannot remove the DELETE outside the loop as there are changes dependent just before the delete and we have a lot of electricity problems here. Any other thoughts.
>>
>>
>>>Hi,
>>>
>>>I think the DELETE is the one causing the problem.
>>>
>>>Try moving the delete outside of the SCAN...ENDSCAN loop and use a DELETE FOR instead (might even be faster this way).
>>>
>>>HTH,
>>>Arriyel
>>>
>>>>Hi all
>>>>
>>>>I have a function skel like below:
>>>>
>>>>
>>>>FUNCTION myFunc
>>>>
>>>>	PARAMETERS myID
>>>>
>>>>	SELECT myDBF
>>>>	SET ORDER TO TAG myField
>>>>
>>>>	= SEEK(myID)
>>>>
>>>>	SCAN WHILE myDBF.myField = myID
>>>>		SELECT myOtherDBF
>>>>		*** myOtherDBF manipulation logic goes here
>>>>
>>>>		SELECT myDBF
>>>>		DELETE
>>>>	ENDSCAN
>>>>
>>>>
>>>>This fails, what am I doing wrong. Just change the WHILE to FOR, though slower will never fail.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform