Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why?
Message
From
11/01/1999 13:37:10
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Why?
Miscellaneous
Thread ID:
00174204
Message ID:
00174724
Views:
29
>They why is simple - the '.' delimiter in the property expression terminates the macro expansion before the property expression is seen. It's much the same reason you can't macro expand a field in the notation < tablealias >.< fieldname

Ed,

I'm jumping into this thread in the middle, so maybe I missed something, but you can in fact macro expand a field name in the notation you give above. You're right about the period terminating the expansion, of course, but the following works fine:
local lcTableName, lcFieldName
lcTableName = 'alfalist'
lcFieldName = 'cName'
?&lcTableName..&lcFieldName.    && trailing period is optional
>
>>
>>>>can I do this:
>>>>
>>>>this.cView = 'ViewName'
>>>>lcView = this.cView
>>>>
>>>>REPLACE &lcView..FieldName WITH value
>>>>
>>>>and not this:
>>>>
>>>>REPLACE &this.cView..FieldName WITH value?
>>>>
>>>>
>>>
>>>Macro substitution doesn't work properly on properties. Why not:
>>>
>>>REPLACE (lcView + '.FieldName') WITH VALUE
>>>
>>>and
>>>
>>>REPLACE (this.cView + '.Fieldname') WITH VALUE
>>>
>>>which should always work...and is faster, too.
>>>
>>>>Thanks in advance.
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform