Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How much faster or slower is to use with..endwith?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00407175
Message ID:
00407328
Vues:
35
When working with VFP innate objects and custom objects created with VFP constructs the difference in access time can be minimal.

But try this same technique when there is a COM barrier between you and the other object (e.g. Word, Excel, custom VFP COM server) and you see the benefits of With/Endwith very quickly. It can shave seconds off processing time instead of milliseconds. It is for this reason I use With/Endwith almost exclusively. The only time I don't is when I have 1 PEM to access.

Just my $0.02.

>Hi Alex,
>I remember seeing the same information as Charlie mentions. However, the difference between .001 sec. and .003 sec. processing time is not going to affect your user. However the With/EndWith statement may save the programmer a lot of hours of tracking down control hierarchies when doing a change or upgrade, though.
>
>Just my $.02 US,
>Barbara
>
>>I have a form with several bizobjs and I need to set properties in all of them.
>>
>>For example, and I now use:
>>
Thisform.bizobj1.vp = 1
>>Thisform.bizobj1.requery()
>>
>>Thisform.bizobj2.vp = 3
>>Thisform.bizobj2.requery()
>>What is the speed change if instead I decide for:
>>
with thisform
>>    with .bizobj1
>>        .vp = 1
>>        .requery()
>>    endwith
>>    with .bizobj2
>>        .vp = 3
>>        .requery()
>>    endwith
>>endwith
>>What criteria should I use to choose either way of doing this?
>>
>>Thanks!
>>
>>Alex
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform