Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: ALEN ArrayName expression don't support dot prefix
Message
From
17/07/2005 21:31:19
Ken Dibble
Southern Tier Independence Center
Binghamton, New York, United States
 
 
To
17/07/2005 03:56:13
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01033297
Message ID:
01033409
Views:
14
>>>
>>>clear
>>>DIMENSION oneArray[1]
>>>ADDPROPERTY(_screen,"oneArray[1]")
>>>* supported ArrayName
>>>? ALEN(oneArray)
>>>? ALEN(m.oneArray)
>>>? ALEN("oneArray")
>>>? ALEN("one"+"Array")
>>>arrayName = "oneArray"
>>>? ALEN((arrayName))
>>>? ALEN((m.arrayName))
>>>? ALEN(_screen.oneArray)
>>>
>>>* BUG : name expression don't support dot prefix
>>>? ALEN("m.oneArray")
>>>? ALEN("_screen.oneArray")
>>>WITH _screen
>>>	? ALEN(".oneArray")
>>>ENDWITH
>>>
>>
>>This works:
>>
>>WITH _screen
>>     ? ALEN(.oneArray)
>>ENDWITH
>>
>
>NEXT it is another BUG, expected a error:
>>So does this:
>>
>>WITH _screen
>>     ? ALEN((.oneArray))
>>ENDWITH
>>
>>You're feeding it a string literal within the WITH ... ENDWITH structure, not a property name expression.
>
>This is more simple
>
>DIMENSION oneArray[1]
>longName='m.oneArray'
>shortName='oneArray'
>? ALEN((shortName)) && this works
>? ALEN((longName))  && this not works, expected works also
>
However, this works:

? ALEN(&longName)

But this doesn't:

? ALEN(EVALUATE(longName))

From my point of view the real anomaly is that it accepts the array name within quotes at all. The help doesn't call for a character string value in ALEN(), just an ArrayName, which I take to be a VFP name expression. All my code using ALEN() supplies the array name as a name expression; it never occurred to me to try feeding it a string. I'd guess that ALEN() is interpreting 'm.oneArray' as a string literal, and there is no array in scope whose name is m.oneArray. However, I don't understand why the macro expansion works but EVALUATE() doesn't.

Ken Dibble
www.stic-cil.org
Previous
Reply
Map
View

Click here to load this message in the networking platform