Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan!!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Scan!!
Divers
Thread ID:
00034138
Message ID:
00034188
Vues:
28
>I am using scan command everytime the form load up, so it calculate every single record. (I want to make sure whatever client enter is being calculate)
>scan
> **calculation
>endscan
>
>I want to know is there any other faster command can get the job done faster. Now, everytime client load the form it take 1 minute or so to open up and that's with 16 meg of ram. I can't imagine if the client have less than 16meg of ram, it probably take a while to load.

Samuel,

You've gotten a ton of advice here, much of it, as usual, excellent. I do have a question and, perhaps a comment, that might apply here.

From what I understand, you're scanning the table, calculating two or more fields and storing the results in another. If that's correct then my question is, "Why are you doing that?" Except in very rare instances, such a practice is generally frowned upon as being poor design. You've discovered part of the reason why. You have to check every record to assure that the calculation has been correctly stored. You've also created additional code that must be maintained, added size to the record and table, and additional overhead in load time.

Consider writing a function, passing the fields as parameters, to return the appropriate result from each record. This could be utilized in a query, to display on a report or form. Then all you have to do is validate user input for the appropriate fields in the Valid method.

If you must store the calculation result, REPLACE ALL can do the trick. I don't believe it's been mentioned so far.

HTH,

George
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform