Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a variable to store an object name
Message
De
05/06/1997 22:10:09
 
 
À
05/06/1997 20:33:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00035059
Message ID:
00035342
Vues:
44
Mr. Stowell,,

While I agree that MS has been advocating usage of "name expressions" in lieu of macros for a long time now for performance reasons, It is also noteworthy that the MS SAMPLE coding is replete with macros!

Hardly the way to convince people to move away from them, especially when you (MS that is) constantly refers people to the sample code for just about anything.

Cheers,
Jim N


>>> Thisform.&cObjectname..property=...). Therefore I like macros and I would
>>
>>> really appreciate to get some bench test numbers comparing speed.
>
>Mr. Pikman:
>I normally don't critique code, but this is particularly bad (not to mention inefficient) from an object-oriented point of view. There are way that this can be done that are much more in line with the OOP paradigm and don't involve macros.
>
>>Check this out :
>>
>>I run this code :
>>
>>*-------
>>lvarname='vn'
>>
>>start = seconds()
>>for x=1 to 10000
>> store 'test' to &lvarname
>>endfor
>>?seconds() - start
>>
>>start = seconds()
>>for x=1 to 10000
>> store 'test' to (lvarname)
>>endfor
>>?seconds() - start
>>*---------
>>
>>First loop = 4.426 sec
>>Second loop = 1.142 sec
>
>Mr. Varzura:
>Thank you for this demonstration. It's simple and clear.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform