>Thank you, sir!
>
>Your suggestion made a very dramatic difference in timing. I had already set an index on play_list_no, but clearly was not using it properly. This is a lesson well-learned, one that will help me to make improvements in other sections of code.
>
>Again, thank you very much, Mr. Basoz, for your valuable time!
Ernie,
Since you're going changes in other sections, a few suggestions here :
-Avoid do while...enddo as much as possible. Scan...endscan, for..endfor are faster (scan ..endscan do an implicit skip, supports "for", "while" and if there is an index benefit it - BTW you can use for and while in conjunction).
-In expressions choose from one that have an index already. ie: You have an index on lastname+firstname and want to search for a lastname in a scan..endscan. Instead of (..for lastname=cLastName) use (.. for lastname+firstname=cLastName) to benefit index automatically (set exact is off by deafult and this would work when exact is off).
-Keep a dummy index tag for deleted (index on deleted() tag dummy).
-Whereever possible use SQL counterparts of commands. ie: instead of (append blank, replace f1 with cF1, f2 with dF2 ...) use (insert into myTable (f1,f2...) values (cF1, dF2...)). This works not only faster, but sometimes prevent extra code errors as well.
List is rather long and detailed in "Optimizing ..." section in online documentation (and help).
Cetin