Bootstrapping a new application

Beginning with PowerBuilder 5.0, you can use ORCA to create the libraries for an entire application from object source code. You don't need to start with an existing PBL.

To import an object, ordinarily you need a library with an Application object that already exists. When you set the Application object to a NULL value during the bootstrap process, ORCA uses a temporary Application object so that you can import your own Application object. But your Application object doesn't become the current application until you close the session, start a new session, and set the current application.

To bootstrap a new application:

  1. Start an ORCA session using PBORCA_SessionOpen.

  2. Create the new library using PBORCA_LibraryCreate.

  3. Set the library list for the session to the new library using PBORCA_SessionSetLibraryList.

  4. Pass NULL variables as the library name and application name with PBORCA_SessionSetCurrentAppl.

  5. Import the Application object into the new library using PBORCA_CompileEntryImportList.

    Do not import other objects now

    Why you should import only the Application object

    Although you can import additional objects into the library, it is not a good idea. In the bootstrap session, the default Application object is the current application. If the objects have any dependencies on your Application object (for example, if they reference global variables), they will cause errors and fail to be imported.

  6. Close the session.

Finishing the bootstrapped application

The bootstrap process gets you started with the new application. To complete the process, you need to import the rest of the objects into one or more libraries.

You can only set the library list and current application once in a session, so you need to start a new ORCA session to finish the process. Since you now have a library with the Application object you want to use, the process is the same as any other ORCA session that imports objects.

To finish the bootstrapped application:

  1. Open another ORCA session.

  2. Create any additional libraries you'll need for the application.

  3. Set the library list to the library created in the bootstrap procedure plus the empty libraries just created.

  4. Set the current application to the Application object imported in the bootstrap procedure.

  5. Import objects into each of the libraries as needed.

When to create the libraries

You can create the additional libraries during the first bootstrap procedure. However, you should not import objects until the second procedure, when the correct Application object is current.