Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 To: Dan Baker
  Where is Dan Baker?
 Effort of the Poconos
 Pennsylvania - United States
 Dan Baker
 Tags
Subject: RE: Simplify column style creation in cnt
Thread ID: 416471 Message ID: 416522 # Views: 39 # Ratings: 1
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Tuesday, December 30, 2014 6:51:21 PM         
   


> >
> >
> > Maybe something like this instead?
> >
> >
With oControl
> > 	.Left = Evaluate('o'+Transform(p)+'.cmdMarginLeft')
> > 	.Width = Evaluate('o'+Transform(p)+'.cmdWidth')
> > 	.Top = = Evaluate('o'+Transform(p)+'.cmdMarginTop')+ m.nTop
> > 	.Caption = Icase(p=1,junk.country,p=2,junk.Region........)
> > 

>
> Excellent, Jun. Showing the solution as you have, makes it look so
> simple, but I racked my brain with no result.
>
> Plus I never used ICASE() before. That's a great function.
>
> Thanks, Dan B.

I'm really hesitant about WITH...ENDWITH. If you call a method in the with, and in that method you have a mistaken .Property, it falls back to the WITH. Very dangerous if unintentional.

It's much clearer to...

op=Evaluate('o'+Transform(m.p))
oControl.Left = op.cmdMarginLeft
oControl.Width = op.cmdWidth
oControl.Top = op.cmdMarginTop + m.nTop
oControl.Caption = Icase(p=1,junk.country,p=2,junk.Region........)


Mike Yearwood
Microsoft MVP Visual FoxPro 2008, 2009
We have enough youth. We need a fountain of smart!
There may be many ways to skin a cat, but there are very few right ways to do it.

ENTIRE THREAD

Simplify column style creation in cnt Posted by Dan Baker @ 12/30/2014 2:47:29 AM
RE: Simplify column style creation in cnt Posted by Jun Tangunan @ 12/30/2014 4:58:43 AM
RE: Simplify column style creation in cnt Posted by Dan Baker @ 12/30/2014 12:46:00 PM
RE: Simplify column style creation in cnt Posted by Mike Yearwood @ 12/30/2014 6:51:21 PM
RE: Simplify column style creation in cnt Posted by Dan Baker @ 12/30/2014 7:15:44 PM
RE: Simplify column style creation in cnt Posted by Mike Yearwood @ 12/30/2014 9:21:00 PM
RE: Simplify column style creation in cnt Posted by Jun Tangunan @ 12/30/2014 9:51:17 PM
RE: Simplify column style creation in cnt Posted by Dan Baker @ 12/30/2014 10:59:55 PM