Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need efficient algorithm - urgent!
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00695565
Message ID:
00695802
Views:
12
Hi Venelina,

Thanks for your comments. I realized later, that I had to copy unordered set, otherwise recno() in the new table would not be the same as in the old.

Anyway, I was able to write algorithm on Saturday 12am and my program eliminated 400 duplicates from 1571 original duplicates. Unfortunately, lots of records were condos with not empty Ass1. My colleague didn't specify, how she would like to handle them.

BTW, the funny thing with this algorithm. I was walking to my colleague'd desk to ask her word ostrich in English (just forgot it). She showed me, that she was doing (she manually was eliminating duplicates). I told her, that it would take me 15 min. to write a program to do so. Well, I overestimated my coding abilities. It took me ~2.5 h.

Hopefully, it would be a good surprise for her on Thursday (tomorrow is a Labor day).

>Hi Nadya,
>
>For me the algorithm seems OK, but I'm not sure you are writting sorted data in the right place
>My comments are bellow
>
>
>scan for Flag='D'
>* you had just moved on the recors with new map15 value
>* but later you are using lnRecno to position your record pointer in Update_File
>* if you are on the record with new map15
>* you will not update your lately procceded map15,
>* but that new one
>* may you have to move that assignments to the end of scan
>* after endif (or if always you first record contains Ass1<>0
>* you may move this code in your
>* if map15<>m.lcMap construction

>
>>	if Ass1<> 0
>>		lnRecno = recno()
>>	endif
>>
>>	if map15<>m.lcMap
>>		if m.llAllow
>>			goto m.lnRecno in Update_File
>>		...........
>* if always you first record contains Ass1<>0
>* you may move this code here

>
>	else
>>		...........
>>	endif
>* may be this is better place for you lnRecno assignment
>
>endscan
>>
>>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform