Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
15/04/1998 07:14:20
 
 
To
14/04/1998 16:32:48
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00090513
Message ID:
00092071
Views:
37
>>Hi Raul,
>>
>>To expand on Carlo's answer: &control..name
>>
>>The reason you need 2 periods: VFP has to know where to stop macro exapansion. So, the first period stops the exapansion and the second separates the object from the member.
>
> Hi John:
>
> Actually the issue was not with objects but with variables.
> var_value = 5
> v1 = 'var_'
> v2 = 'value'
> output = &v1.&v2
>
> Doing some speed tests the following is the best sollution (almost half the time to complete):
> var_value = 5
> v1 = 'var_'
> v2 = 'value'
> output = EVAL(v1 + v2)
>
> Of course those are generic examples and is not the way I'm appliying it.
> Since the speed of EVAL() is about twice the speed of using &, is there a way
> of doing the following using EVAL()?
>
> var_value = 5
> var_name = 'var_value'
> &var_name = 6 && var_value is now 6
>
> I don't see a way of using EVAL() to accomplish that, but I might be missing something.
>
>TIA

try:

var_name = 'var_value'
store 6 to (var_name)

var_value is now 6, and name resolution is tons faster than macro expansion.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform