Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Huw Jones
  Where is Huw Jones?
 Bendigo
 Australia
 Huw Jones
 Tags
Subject: RE: Identifying if object exisits
Thread ID: 189053 Message ID: 189374 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Thursday, August 14, 2008 4:30:27 PM         
   


> 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'
>
> I was wondering what command to use to check this immediately prior to the addobject command so that I can trap the error before it occurs and take the relevant action.
>
> Thanks in advance
>
> Huw

* Check to see if the control named "yourcontrolname" installed and loaded.
*it can be any control even an activeX.

IF TYPE("THIS.yourcontrolname") # "O" OR ISNULL(THIS.yourcontrolname)
thisform.addObject..... &&control tested not exist
else
return .f.    &&control tested exists
ENDIF


Regards
Yousfi Benameur

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