Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow LOCATE command in _Assign method
Message
From
13/05/2010 22:31:51
 
 
To
13/05/2010 13:59:09
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01463679
Message ID:
01464516
Views:
34
>>>* Possibly hard-to-debug bugs where WITH context gets carried into called function/procedure/PRG.
>>>
>>>Kind'a too bad really -- WITH comes in handy when you're accessing properties/methods of an object that's nested deeply (e.g. textbox within a cell within a column of a grid within a container within a page of a pageframe within a page of a pageframe in a form). Intent of the code is much clearer than repeatedly referring to the deeply-nested object.
>>
>>Assigning a temporary object reference gives you clarity and speed - especially when activeX-access is involved.
>
>Of course one needs to be very careful about variable reuse in the cases where you would've had more than one WITH..ENDWITH in effect.

As the effects are more marked in the inner loops, it is often only necessary to hoist long
property walking statemets once ore twice out of the innermost loops. Add that with
descriptive temp names (loTempDoc, loTempRow instead of lo1, lo2) and you are set.

HTH

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform