Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding Object doesn't exist...
Message
From
21/04/1999 13:26:01
 
 
To
20/04/1999 17:27:27
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00210312
Message ID:
00210639
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform