Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rewrite
Message
From
22/01/2007 06:56:36
 
 
To
22/01/2007 02:30:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01187577
Message ID:
01187602
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform