Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is faster: insert from memvar or insert fields?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01139366
Message ID:
01145540
Views:
27
>Hi Mike
>
>>>It's really funny. In the program that used by several developers my colleague put **** PLEASE DO NOT PLACE "m."s *** at the top and removed m. even from my procedures <g>
>>
>>That's not funny. That's plain stupid. Leaving them in will prevent errors and improve performance. Taking them out ONLY changes how the code looks in an insignificant way.
>
>I just jumped into this thread, so please forgive me if this is already brought up.
>
>What would happen when...
>
LOCAL lcMyVar
>
>lcMyVar = MyTable.cMyVar
>
>Is this efficient and still avoids the problems and improves performance?

Yes, it's efficient. I always add table aliases to avoid ambiguity. We're talking about lcVar = m.lcAnotherVar In this case m. indicates, that it's a memory variable and not a table field. Following strict naming convention reduces risk of running into table field to almost 0%. The performance difference would be visible only in lots of iterations...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform