Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for BOF() with filter taking ages
Message
De
31/03/2001 10:58:47
 
 
À
31/03/2001 07:36:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00490568
Message ID:
00490596
Vues:
18
Helo, Ian.

Well, sort of. The whole BOF() thing annoys me as well. A trick I like to use is to have a Form property called FirstRecord. This property stores the first record number for the main alias in the Form. Whenever I requery the main alias if a view or set a filter (I don't do much with filters) and in Form.Init, I do a LOCATE (same as GO TOP only reputably faster) and store the first record number (or 0 if no records) to Form.FirstRecord.

On Refresh, then, or where appropriate, if the RECNO('mainalias') = Form.FirstRecord I know I'm at the logical beginning of the file ... regardless of the setting of the BOF() ( which is only true when you try to move ahead of the first record).

>I am applying a filter to a table with just over 110,000 records and it is taking ages to return the data. After using the coverage profiler I have discovered that it is not so much the filter expression (which is optimised) that is soooo sloooow but the refresh on the navigation bar buttons. The main cause is the checking for 'Top of form' using:
>
>SKIP - 1 &&&Offending line takes over 30 seconds to execute
>If BOF()
> *---Code goes here---*
>Endif
>SKIP 1
>
>Does anyone please have any good ideas of getting round this?
>
>Many thanks
>
>Ian Baxter
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform