Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My wish to VFP 7.0
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00484748
Message ID:
00485470
Views:
14
Hi Eric,

>>Can you give me an example?
>
>Sure:
>
>
>Lets say I'm wanting to set the color of a shape in a graphical
>representation of some data. I have a mask to tell me what to do...
>
>for lnCnt = 1 to SliderPosition
> for lnCnt2 = 1 to SomeNumberOfShapes
>   if occurs("T", lcCurMask) > 0
>     lcCommand = "this.Object"+allt(str(lnCnt-lnSlider+1))+;
>	         ".shape"+allt(str(lnCnt2))+".visible = .T."
>     &lcCommand
>     lcCommand = "this.Object"+allt(str(lnCnt-lnSlider+1))+;
>		 ".shape"+allt(str(lnCnt2))+".backcolor = rgb(0,255,0)"
>     &lcCommand
>   endif
> endfor
>endfor
>
>
>
>The example is not complete but basically I'm setting the visible and color properties of a row of shapes in an object based on the count minus the position of a slider control plus one. :)

Just to play devil's advocate...<G>
Couldn't you avoid the macro expansion like this:
loCtrl = "this.Object"+allt(str(lnCnt-lnSlider+1))+".shape"+allt(str(lnCnt2))
with loCtrl
   .visible = .T.
   .backcolor = rgb(0,255,0)
endwith
Not saying this is better or worse, but the original post was to say macro expansion could be avoided.
Bill Armbrecht
VFP MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform