Using global standard class user objects

Several standard class user object types are inherited from predefined global objects used in all PocketBuilder applications:

Replacing the built-in global object

If you want your standard class user object to replace the built-in global object, you tell PocketBuilder to use your user object instead of the built-in system object that it inherits from. You will probably use this technique if you build a user object that inherits from the Error or Message object.

In Figure 14-3, user objects have been assigned to replace the default Transaction and Error objects.

Figure 14-3: Replacing default global objects

Shown is the Variable Types tab of the Application properties dialog box. It has three vertically aligned text boxes. In this example, the text box at top labeled Sequel C A is set to the u _ cust _ transaction user object. The Error text box displays u _ cust _ error and the Message text box displays the default entry, Message.

StepsTo replace the built-in global object with a standard class user object:

  1. Open the Application object.

  2. In the Properties view, click the Additional Properties button on the General tab page.

  3. In the Application properties dialog box, select the Variable Types tab.

  4. Specify the standard class user object you defined in the corresponding field and click OK.

After you have specified your user object as the default global object, it replaces the built-in object and is created automatically when the application starts up. You do not create it (or destroy it) yourself.

The properties and functions defined in the user object are available anywhere in the application. Reference them using dot notation, just as you access those of other PocketBuilder objects such as windows.

Supplementing the built-in global object

You can use a user object inherited from one of the built-in global objects by inserting one in your user object as described in “Using class user objects”. If you do, your user object is used in addition to the built-in global object variable. Typically you use this technique with user objects inherited from the Transaction object. You now have access to two Transaction objects: the built-in SQLCA and the one you defined.

For more information

For more information about using the Error object, see “Using the Error object”.

For information about using the Message object, and about creating your own Transaction object, see the Resource Guide.