Index
2011-02-22 14:12Steve Ellenoff : Variable name oddity?
2011-02-22 14:15Lew : Re: Variable name oddity?
2011-02-22 14:16Ted Roche : Re: Variable name oddity?
2011-02-22 14:17Jarvis, Matthew : RE: Variable name oddity?
2011-02-22 14:18Paul Hill : Re: Variable name oddity?
2011-02-22 14:26Steve Ellenoff : Re: Variable name oddity?
2011-02-22 16:38Grigore Dolghin : RE: Variable name oddity?
2011-02-22 16:50MB Software Solutions, LLC : Re: Variable name oddity?
Back to top
Variable name oddity?

Author: Steve Ellenoff

Posted: 2011-02-22 14:12:03   Link

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

_______________________________________________

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/442491.97828.qm@smtp125.sbc.mail.sp1.yahoo.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.

©2011 Steve Ellenoff
Back to top
Re: Variable name oddity?

Author: Lew

Posted: 2011-02-22 14:15:07   Link

"e" is a valid workarea name.

Lew

-----Original Message-----

From: Steve Ellenoff <sellenoff@pinmame.com>

Sender: profoxtech-bounces@leafe.com

Date: Tue, 22 Feb 2011 14:12:03

To: <profoxtech@leafe.com>

Reply-To: profox@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

_______________________________________________

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/442491.97828.qm@smtp125.sbc.mail.sp1.yahoo.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.

Report [OT] Abuse: http://leafe.com/reportAbuse/442491.97828.qm@smtp125.sbc.mail.sp1.yahoo.com

_______________________________________________

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/1897554021-1298402108-cardhu_decombobulator_blackberry.rim.net-1240047944-@bda360.bisx.prod.on.blackberry

** 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.

©2011 Lew
Back to top
Re: Variable name oddity?

Author: Ted Roche

Posted: 2011-02-22 14:16:09   Link

On Tue, Feb 22, 2011 at 2:12 PM, Steve Ellenoff <sellenoff@pinmame.com> wrote:

> I'm sure someone has a rational explanation for this odd behavior??

By Design <s>.

> 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..

Single letters are assumed to be aliases for work areas a through j.

Don't use them as objects. For that matter, don't use them as work

areas, either, aliases are much better ways to refer to tables and

cursors.

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

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/AANLkTi=5_0Uy3vmKd2OiCk6w+_DzoW3N4JtN=Gcj7bqn@mail.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.

©2011 Ted Roche
Back to top
RE: Variable name oddity?

Author: Jarvis, Matthew

Posted: 2011-02-22 14:17:38   Link

> -----Original Message-----

> From: profoxtech-bounces@leafe.com

[mailto:profoxtech-bounces@leafe.com]

> On Behalf Of Steve Ellenoff

> Sent: Tuesday, February 22, 2011 11:12 AM

> 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..

Very hazy memory... Wasn't there a time when FP or FoxBase would reserve

these names as default table aliases or something like that?

Wonder if some old legacy code is in the version you are running....

Just a total WAG...

Thanks,

Matthew Jarvis || Business Systems Analyst

IT Department

McKenzie-Willamette Medical Center

1460 G Street, Springfield, OR 97477 || Ph: 541-744-6092 || Fax:

541-744-6145

--------------------------------------------------------------------------

Disclaimer: This electronic message may contain information that is

Proprietary, Confidential, or legally privileged or protected. It

is intended only for the use of the individual(s) and entity named

in the message. If you are not an intended recipient of this

message, please notify the sender immediately and delete the

material from your computer. Do not deliver, distribute or copy

this message and do not disclose its contents or take any action in

reliance on the information it contains.

_______________________________________________

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/69F310C05DD83C48A84BA3769CE1ECF804501065@TNTRIEXEVS02.triadhospitals.net

** 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.

©2011 Jarvis, Matthew
Back to top
Re: Variable name oddity?

Author: Paul Hill

Posted: 2011-02-22 14:18:23   Link

On Tue, Feb 22, 2011 at 7:16 PM, Ted Roche <tedroche@gmail.com> wrote:

> Single letters are assumed to be aliases for work areas a through j.

> Don't use them as objects. For that matter, don't use them as work

> areas, either, aliases are much better ways to refer to tables and

> cursors.

Don't you just love backwards compatibility ;-)

Here's another one:

Use tablename

123

'123' is equivalent to 'GO 123'

--

Paul

_______________________________________________

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/AANLkTi=sG_Qj=3xOBv1Svm5rT-QFUhfFMMn+Mejnnr8z@mail.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.

©2011 Paul Hill
Back to top
Re: Variable name oddity?

Author: Steve Ellenoff

Posted: 2011-02-22 14:26:21   Link

Thanks guys.. I had a hazy recollection that it was related to work

areas when I posted it, but wanted to get full clarification.. :)

Luckily I never use single letter vars in real code, but I was being

lazy about testing out some class code methods in the class' prg

itself, and I got busted.. LOL!

-Steve

At 02:16 PM 02/22/2011, you wrote:

>On Tue, Feb 22, 2011 at 2:12 PM, Steve Ellenoff <sellenoff@pinmame.com> wrote:

> > I'm sure someone has a rational explanation for this odd behavior??

>

>By Design <s>.

>

> > 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..

>

>Single letters are assumed to be aliases for work areas a through j.

>Don't use them as objects. For that matter, don't use them as work

>areas, either, aliases are much better ways to refer to tables and

>cursors.

>

>--

>Ted Roche

>Ted Roche & Associates, LLC

>http://www.tedroche.com

>

[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/281897.41815.qm@smtp102.sbc.mail.ac4.yahoo.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.

©2011 Steve Ellenoff
Back to top
RE: Variable name oddity?

Author: Grigore Dolghin

Posted: 2011-02-22 16:38:21   Link

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.

©2011 Grigore Dolghin
Back to top
Re: Variable name oddity?

Author: MB Software Solutions, LLC

Posted: 2011-02-22 16:50:00   Link

On 2/22/2011 4:38 PM, Grigore Dolghin wrote:

> 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()

Ah yes, the m. is the key!

--

Mike Babcock, MCP

MB Software Solutions, LLC

President, Chief Software Architect

http://mbsoftwaresolutions.com

http://fabmate.com

http://twitter.com/mbabcock16

_______________________________________________

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/4D642F88.2020401@mbsoftwaresolutions.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.

©2011 MB Software Solutions, LLC