Well, it works if you inform VFP that you want to access the variable, not
the working area:

Local e
e = CreateObject("myclass")
m.e.Hello()

> -----Original Message-----
> From: [email protected] [mailto:profoxtech-
> [email protected]] On Behalf Of Steve Ellenoff
> Sent: Tuesday, February 22, 2011 9:12 PM
> To: [email protected]
> Subject: Variable name oddity?
> 
> I'm sure someone has a rational explanation for this odd behavior??
> 
> If I run the following code it fails with a syntax error on the method
call, but if
> I use the variable x or y, for example it works just fine as expected.
Other
> vars that failed were a,b,c,d,f.
> I didn't try any other than those..
> 
> Why is it that VFP doesn't like me using the variables of a, b, c, d, e, f
(
> perhaps others? ).
> 
> LOCAL e
> e = CREATEOBJECT("myclass")
> ?e.hello()   <<-- Syntax error when compiling the PRG
> 
> DEFINE CLASS myclass AS Custom
> FUNCTION hello()
>          RETURN "hello"
> ENDFUNC
> ENDDEFINE
> 
> Changing the e variable to an x works as shown below:
> 
> LOCAL x
> x = CREATEOBJECT("myclass")
> ?x.hello()   <<-- WORKS AS EXPECTED
> 
> DEFINE CLASS myclass AS Custom
> FUNCTION hello()
>          RETURN "hello"
> ENDFUNC
> ENDDEFINE
> 
> 
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to