Building a custom class user object

On the PB Object tab page of the New dialog box, if you select Custom Class and click OK, the User Object painter for custom class user objects opens.

StepsTo build the custom class user object:

  1. Declare functions, structures, or variables you need for the user object.

  2. Create and compile scripts for the user object.

    Custom class user objects have built-in constructor and destructor events.

  3. Save the user object.

    See “Saving a user object”.

Using AutoInstantiate

You can create custom class user objects that are autoinstantiated, which provides you with the ability to define methods.

Autoinstantiated user objects do not require explicit CREATE or DESTROY statements when you use them. They are instantiated when you call them in a script and destroyed automatically.

StepsTo define an autoinstantiated custom class user object:

  1. In the Properties view, select the AutoInstantiate check box.

For more information about autoinstantiation, see the PowerScript Reference.

Using the EAServer Project property

In the Properties view, if you specify an EAServer or Application Server project that will be used to generate an EAServer or Application Server component (a custom class user object with the characteristics needed for deployment to an application server), live editing is enabled. When live editing is enabled in the User Object painter, PowerBuilder builds the project for an application server component each time you save the user object.

For information about EAServer components and live editing, see Application Techniques.