Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Vivek Deodhar
  Where is Vivek Deodhar?
 SANGLI
 India
 Vivek Deodhar
 Tags
Subject: RE: I have Little proble with Class
Thread ID: 248740 Message ID: 249190 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Wednesday, December 30, 2009 9:30:32 AM         
   


> Hi Stefan,
>
> Re:
> * better:
> Local loGrid as Grid
> loGrid = GetPem("thisform."+This.lstobj)
> loGrid.Visible = .T.
> loGrid.SetFocus()
>
> In this code, second line is:
> loGrid = GetPem("thisform."+This.lstobj)
>
> Would not this line throw an error of "too few arguments"? (because no method or property name is specified)
>
> Should it not be loGrid = evaluate("thisform."+This.lstobj),so that following
> two lines for visible=.t. and setfocus() can be successfully executed?
>
> vivek

Hi Vivek,

Indeed, Evaluate() would work certainly well in that context.

[added:
Just saw, there was a typo in the previous example, thanks for pointing out!

So GetPem() works too if it's used in a syntactically correct way :-)
]

loForm = CREATEOBJECT('Form')
loForm.AddObject('Text1','Textbox')
loForm.AddObject('Text2','Textbox')

lcControl = 'Text2'
? PEMSTATUS(m.loForm,m.lcControl,5) && .T.
loTextbox = GETPEM(m.loForm, m.lcControl)
? VarType(m.loTextbox) && 'O'
loTextbox.Move(50,50)
loTextbox.BackColor = RGB(255,0,0)
loTextbox.Visible = .T.
loForm.Show()

lcProperty = 'Caption'
? PEMSTATUS(m.loForm,m.lcProperty,5) && .T.
lcContent = GETPEM(m.loForm, m.lcProperty)
loTextbox.Value = m.lcContent

? PEMSTATUS(m.loForm,'undefined',5) && .F.


ENTIRE THREAD

I have Little proble with Class Posted by Neeraj Charne @ 12/22/2009 7:48:22 PM
RE: Stefan...i have Little proble with Class Posted by Stefan Wuebbe @ 12/23/2009 10:29:51 AM
RE: Stefan...i have Little proble with Class Posted by Neeraj Charne @ 12/23/2009 6:30:40 PM
RE: I have Little proble with Class Posted by Stefan Wuebbe @ 12/23/2009 6:57:22 PM
RE: I have Little proble with Class Posted by Neeraj Charne @ 12/23/2009 8:55:47 PM
RE: I have Little proble with Class Posted by anand kulkarni @ 12/24/2009 3:58:32 AM
RE: I have Little proble with Class Posted by Neeraj Charne @ 12/25/2009 10:58:07 AM
RE: I have Little proble with Class Posted by anand kulkarni @ 12/26/2009 1:03:18 PM
RE: I have Little proble with Class Posted by Stefan Wuebbe @ 12/24/2009 8:42:59 AM
RE: I have Little proble with Class Posted by Neeraj Charne @ 12/25/2009 11:15:47 AM
RE: I have Little proble with Class Posted by Jun Tangunan @ 12/26/2009 4:20:04 AM
RE: I have Little proble with Class Posted by Stefan Wuebbe @ 12/26/2009 8:34:21 AM
RE: I have Little proble with Class Posted by vivek deodhar @ 12/30/2009 6:15:42 AM
RE: I have Little proble with Class Posted by Stefan Wuebbe @ 12/30/2009 9:30:32 AM