Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to find orphans - seek vs SQL
Message
 
 
To
22/11/2000 17:42:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00444141
Message ID:
00444821
Views:
14
Hi Trey,

Yes, I haven't thought, that if count returns 0, I don't need a scan :) I have to check, if count for would be faster than scan for. Since I'm at home now and data at work, and I don't want to use PCAnyWhere, I'll wait till Monday to resume my tests.

And, I remembered, that I have a nice Yuri Rubinov's progbar for COUNT, APPEND), SUM(), etc. I may use it. HourGlass appears automatically, when system is busy. If I do not want to be fancy, wait window would be enough. And, besides, it's not my application, so I don't have to worry at all :)

Thanks again, Trey for your insights. BTW, have you noted keymatch() to use in your applications? It was a very useful tip, I think.

Another great tip, is your idea of property_Assign and SetAll(). Great trick!

>>>>Hi Walter,
>>>>
>>>>First of all, I would like to thank you again for this solution. I added a new FAQ entry about it, it would appear soon.
>>>>
>>>>Secondly, do you know, is there a way to display a thermometer here?
>>>>If I use scan...endscan for the whole file, I can show a progress bar easily. Since here I use a scan for !keymatch(...), this technique would not work. Do you have ideas? If not, it's not critical, wait window would be enough, I think.
>>>>
>>>
>>>You would have to get a COUNT FOR !KEYMATCH(... first to have an upper end for the progress bar.
>>>
>>>Is an index in use? If not, you could still use a progbar, just get the percent using recno()/reccount()*100 - if you get to eof() and the progress bar isn't done, force it to 100. It will jump periodically instead of having a smooth incrementation, but people are used to seeing M$ progress bars do that <g>
>>
>>Hi Trey,
>>
>>Could you please elaborate more? Suppose, you have 0 orphans. Scan for !keymatch() still took some time, because it's like setting a filter on a table. lnCount inside scan would be 0. Could you show in code, how can I display a progress bar in this situation? It's not critical, as I said, I just like to show something, to demonstrate, that system is working. Perhaps, Tom Cahagan (?) with his avi progress bar could help here. Tom, do you have an idea for this?
>>
>>Thanks.
>
>You would do the COUNT FOR before the SCAN - if it came out to 0, you wouldn't need to go into the scan. :)
>
>Most progress bars (like the ActiveX control that ships with VFP6) would have a value set to the % out of 100 to set it to. But in order to know this % you need to know the upper limit - this you get from the COUNT FOR
>That would mean that the progress bar only reflects the actual count of records being processed. iow,
count for (expression) to lncnt
>lneach = 0
>scan for (expression)
>  lneach = lneach + 1
>  progressbar.value = lneach/lncnt*100.00
>endscan
If you went with the reccount() approach, the progress bar would reflect the total number of records, so it would pause (not jump - got it backwards the first time) while it doesn't hit, e.g.
scan for (expression)
>  progressbar.value = recno()/reccount()*100.00
>endscan
>I suppose what you're looking for is a progress bar for the "pause" time - the time in between hits. I don't think that's possible, but some sort of indication that it's still working would be good e.g. hourglass
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform