Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a variable to store an object name
Message
From
05/06/1997 22:10:09
 
 
To
05/06/1997 20:33:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00035059
Message ID:
00035342
Views:
47
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform