Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why?
Message
From
12/01/1999 09:53:09
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Why?
Miscellaneous
Thread ID:
00174204
Message ID:
00175025
Views:
58
>>>Actually, you could simply say EVAL(ALLTRIM(lcTableName - '.' - lcFieldName))
>>>
>>>This is a single eval, and the ALLTRIM and "-" concatenations are only needed to deal with leading and trailing blanks. Without the issue of blanks (which macro evaluation can't handle in any case, since you can't macro expand the result of a function), EVAL(lcTableName + '.' + lcFieldName) works just great.
>>
>>That's much cleaner. It seems that EVAL(lcTableName + '.' + lcFieldName) works even with leading and/or trailing blanks in lcTableName and lcFieldName, though.
>
>With trailing blanks on lcFieldName, or leading blanks on lcTableName only. The "-" concatenation fixes the problem where lcTableName = "MyAlias ".

That's interesting. Testing it here (under VFP 5.0a), the "+" concentenation works with both leading and trailing blanks in both lcTableName and lcFieldName. This code
use alfalist
lcTableName = '  alfalist  '
lcFieldName = '  cName  '
?EVAL(lcTableName + '.' + lcFieldName)
correctly displays the value of the cName field in alfalist.
Rick Borup, MCSD

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

Click here to load this message in the networking platform