Author: Grigore Dolghin
Posted: 2011-02-22 at 16:38:21
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: profoxtech-bounces@leafe.com [mailto:profoxtech-
> bounces@leafe.com] On Behalf Of Steve Ellenoff
> Sent: Tuesday, February 22, 2011 9:12 PM
> To: profoxtech@leafe.com
> 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: ProFox@leafe.com
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/000301cbd2d8$d451f160$7cf5d420$@gmail.com
** 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.