Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding Object doesn't exist...
Message
De
21/04/1999 13:26:01
 
 
À
20/04/1999 17:27:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Divers
Thread ID:
00210312
Message ID:
00210639
Vues:
24
Hi Bob.

>In my validation class, prior to getting the Properties for a table.field object, I want to be sure it exists so I don't raise an error message.

DBCXGetProp() won't give an error if lDebugMode is .F. -- it just returns .NULL. if either the object or the property don't exist.

>Is DBCFindObject the best way to go?

DBCXFindObject() is intended to position a DBC which is opened as a table to a particular record, so that won't really do what you want here.

>a DBCXIsObject() kind of thing would be nice.

There sort of is one, although I tend to just use DBCXGetProp() and see if it returns .NULL. You could call the FindObject() method of oCoreMgr. It expects the object name, type, and DBC to all be passed (ie. no empty parameters) and returns .T. if it found the object in COREMETA. Here's an example:

if oMeta.oCoreMgr.FindObject('customer', 'table', dbc())
* object exists
endif

Doug
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform