Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rewrite
Message
De
22/01/2007 06:56:36
 
 
À
22/01/2007 02:30:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01187577
Message ID:
01187602
Vues:
26
>this code under it works, is there another way to rewrite it...
>[SNIP]



For starters, never use an area by number. Your program should not care where the files are open. Do a SELECT 0 if you need to get the next available area, then chose the file by alias, not area number.

You can replace the whole DO WHILE with SCAN..ENDSCAN and the whole assignment with SCATTER MEMVAR (or SCATTER MEMEVAR NAME if you prefer an object).
create table newcurbilldata (....)
select 0
use curbilldata
scan
   scatter memvar
   * do your data manipulation here
   inset into newcurbilldata from memvar
endscan
Also, never use single letter variables from "a" to "j" plus "m" as they are reserved words:
m.d=Sec2Str(tot_m)
This is not safe. Just change the variable names.

There could be other, more optimized ways, but this one is the first that jumpos out.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform