Home > Archive > FoxPro Help and Support > October 2005 > Variables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Variables
MarcF

2005-10-27, 8:34 am

Hi!

I am newbie and created a month calendar with label.
I named those label L01, L02 etc…
Is there a way to change the background color using a variable?
I tried:
MColor = "thisform.L01"
MColor.BackColor = RGB(255,0,0)

Thanks
Marcf
Fred Taylor

2005-10-27, 8:34 am

&MColor..BackColor = RGB(255,0,0)


You need the 2 "." after the variable name because the macro will stop at
the first "." it encounters.

--
Fred
Microsoft Visual FoxPro MVP


"MarcF" <MarcF@discussions.microsoft.com> wrote in message
news:A6405CEF-A67E-4D0B-91E9- F2F5FDCE3C65@microso
ft.com...
> Hi!
>
> I am newbie and created a month calendar with label.
> I named those label L01, L02 etc.
> Is there a way to change the background color using a variable?
> I tried:
> MColor = "thisform.L01"
> MColor.BackColor = RGB(255,0,0)
>
> Thanks
> Marcf



Lee Mitchell

2005-10-27, 8:34 am

Hi MarcF:

Have you tried macro substitution?

MColor = "thisform.L01"
&MColor.BackColor = RGB(255,0,0)

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/i...cid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

>Hi!


>I am newbie and created a month calendar with label.
>I named those label L01, L02 etc…
>Is there a way to change the background color using a variable?
>I tried:
>MColor = "thisform.L01"
>MColor.BackColor = RGB(255,0,0)


>Thanks


Jack Jackson

2005-10-27, 8:34 am

On Wed, 19 Oct 2005 07:47:07 -0700, "MarcF"
<MarcF@discussions.microsoft.com> wrote:

>Hi!
>
>I am newbie and created a month calendar with label.
>I named those label L01, L02 etc…
>Is there a way to change the background color using a variable?
>I tried:
>MColor = "thisform.L01"
>MColor.BackColor = RGB(255,0,0)


MColor = "thisform.L01"
&MColor..BackColor = RGB(255,0,0)

or more efficiently:

MColor = thisform.L01
MColor.BackColor = RGB(255,0,0)

Jack Jackson

2005-10-27, 8:34 am

That should be:

&MColor..BackColor = RGB(255,0,0)

Two periods are needed, one to terminate the macro expression and the
other for the separator between the object and property names.


On Wed, 19 Oct 2005 15:28:12 GMT, Leemi@online.microsoft.com (Lee
Mitchell) wrote:
[color=darkred]
>Hi MarcF:
>
>Have you tried macro substitution?
>
>MColor = "thisform.L01"
>&MColor.BackColor = RGB(255,0,0)
>
>I hope this helps.
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>Sincerely,
>Microsoft FoxPro Technical Support
>Lee Mitchell
>
>*-- VFP9 HAS ARRIVED!! --*
>Read about all the new features of VFP9 here:
>http://msdn.microsoft.com/vfoxpro/
>
>*--Purchase VFP 9.0 here:
>http://www.microsoft.com/PRODUCTS/i...cid=54787e64-52
>69-4500-8bf2-3f06689f4ab3&type=ovr
>
>Keep an eye on the product lifecycle for Visual FoxPro here:
>http://support.microsoft.com/gp/lifeselectindex
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retired Sept. 30th, 2003
>
>
>
MarcF

2005-10-27, 8:34 am

Thank you, your good.

It worked with two dots,

Marcf


"Jack Jackson" wrote:

> On Wed, 19 Oct 2005 07:47:07 -0700, "MarcF"
> <MarcF@discussions.microsoft.com> wrote:
>
>
> MColor = "thisform.L01"
> &MColor..BackColor = RGB(255,0,0)
>
> or more efficiently:
>
> MColor = thisform.L01
> MColor.BackColor = RGB(255,0,0)
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com