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: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 Tags
Subject: RE: Identifying if object exisits
Thread ID: 189053 Message ID: 189367 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Thursday, August 14, 2008 3:49:48 PM         
   


> >
> > You can use PemStatus() (or Type()):
> >
> > ? PEMSTATUS(_screen,'Caption',5)
> > 

> >
> > hth
> > -Stefan
>
> PEMstatus by definition is to find Properties, Events and Methods of an object. How can you use it to find out if an Object exists unless you assume that the object exists in the first place.
>
> The correct function would be TYPE() or better still VARTYPE()

PemStatus() would work here because he wants to add an object to a form, so that the P of PEM would be his letter in this case:

> > > I am using the addobject command to add objects to a form.
> > > I sometimes get an error 1771 which states 'A member object with this name already exisits'

o = CREATEOBJECT('Form')
? PEMSTATUS(o,'FirstControl',5) && prints .F.
o.AddObject('FirstControl','Commandbutton')
? PEMSTATUS(o,'FirstControl',5) && prints .T.



hth
-Stefan

ENTIRE THREAD

Identifying if object exisits Posted by Huw Jones @ 8/13/2008 8:25:29 AM
RE: Identifying if object exisits Posted by Stefan Wuebbe @ 8/13/2008 8:29:15 AM
RE: Identifying if object exisits Posted by Bernard Bout @ 8/14/2008 3:33:50 PM
RE: Identifying if object exisits Posted by Stefan Wuebbe @ 8/14/2008 3:49:48 PM
RE: Identifying if object exisits Posted by Vinay Pagaria @ 8/13/2008 8:29:34 AM
RE: Identifying if object exisits Posted by Yousfi Benameur @ 8/14/2008 4:30:27 PM