PowerGen Tips

 

Common problem with Bootstrap Import

When you're first starting to use the Bootstrap Import feature of PowerGen, you may see a message like the following: 'File "d:\builds\u_objectx.sru" does not have valid export format.' This is probably due to the object missing the $PBHeader information that is normally found at the beginning of exported files. In some versions of PowerBuilder, the source control interface (SCC-API) removes this informatin when objects are checked in. In the Options->Import dialog you can set the "Import files do not include $PBHeader... info" option and then the import should work.

Migrating Applications

You can use the Bootstrap Import feature to migrate your applications from one PowerBuilder release to the next. Use the following process: In PowerGen open the project you want to migrate. Export all of the objects using the Application->Export->To PBL Subdirectories function. Create an Object List File (OLF), be selecting Application->Create OLF. Delete the existing (older version PBLs). Bootstrap Import the objects into a new set of PBLs; select Application->Bootstrap Import. Many customers have reported success doing their migrations this way. It handles certain object dependencies during the Import that PowerBuilder does not handle, and can be completely encapsulated in a batch process using PowerGen's command line features.

AT Scheduler with Network Drives

The AT scheduler (on Windows NT) can not access certain file servers when the Scheduler service uses the "Log On As System Account". When connecting to network resources, it is recommended that you use the Log On As User Account option when possible. (Thanks to Jim Strupp, 3M, for help in tracking this down.)

Application Icons

To display an icon with an application built with PowerGen, you must specify its path in the File Specifications tab of the Project Options. PowerGen (ORCA) does not have access to the application icon that has been saved with the application object. Windows NT vs. Windows 95/98 (7/23/99) We highly recommend Windows NT over Win 95/98 as a build system. It has proven to offer better performance and reliability. We have also observed system resource depletion in Win 95/98, when using PowerBuilder, that is not aapparent in NT.

Error File with Code 116

PowerGen creates an error file before it starts a build operation, in case the build crashes or comes to some other abrupt end. This initial error file is written with an error code of '116'. When the build operation completes, the error file is either removed, if there are no errors, or rewritten with a different code indicating the source of the error. If you are finding the error file with the 116 code, when you're not expecting it, check to make sure you are letting the build operation complete before checking the file. Use "Start /Wait Pwrgn..." to ask the command processor to wait for PowerGen to complete before continuing to the next script command.

Machine Code Generation

There have been on-again/off-again problems in generating MACHINE CODE with the ORCA interface. The ORCA interface is an API, supplied by Sybase, to access PowerBuilder's build and library management functions. We have reported these problems to Sybase. Although they have fixed some of them, others are left unfixed and, worse, some fixes have regressed. There have been no such problems with P-CODE. While we will continue to press Sybase for a full solution, our sincere recommendation is to use p-code deliverables. With machine code the build times are unacceptably long, the build AND run-time environments are less stable and the deliverables are much larger. The benefit of machine code, i.e. that it improves performance, is, in nearly all cases, immeasurable. It is a feature which has been essentially abandoned by the PB development community.

"Creation of EXE Failed"

During the creation of EXE’s and dynamic libraries, you may see this (highly descriptive) error message. This is a PowerBuilder error and is caused in most cases by spaces or blank lines in a resource file (PBR). Make sure there are no extraneous blanks, including trailing blank lines, in your PBR’s. A second cause of this error is a bad icon file specified. Icon files are different than bitmaps or other graphic formats. Naming a non-icon file will also produce this message. You can expect to see features in future releases of PowerGen that prevent these errors from occurring or at least provide more informative error messages.

Scheduling a Build with PowerGen

If you are using PowerGen with Windows NT, you can schedule builds using PowerGen’s command line interface and NT’s ‘at’ Scheduler. The steps needed to do this are:

  1. Make sure the Schedule service is running. Do this in the Services section of the Control Panel. You may start it manually or choose to have it start automatically whenever you start NT.
  2. Create a batch file with the desired PowerGen command line functions. Use fully qualified filenames for consistent operation. For example, c: cd\powergen c:\powergen\pwrgn532.exe /r=c:\powergen\power1.gen
  3. Open an MS/DOS window and submit the batch file to the Scheduler at 02:00 c:\powergen\powergen.bat
  4. Go home and let PowerGen and the Scheduler do the work.

Building Applications with Shared Libraries

One of PowerGen’s build features is the control it gives you in defining your build process. A good example is building applications which share run-time libraries, either PBD’s or DLL’s. In general you want to build the libraries once and, subsequently, just reference them in building other applications. To do this follow these steps:

  1. Define a PowerGen project that includes all the applications that use the common libraries.
  2. In the first application that uses the common libraries, set the options for the common libraries to Regenerate-‘Include’ and Build Now (checked)
  3. In the subsequent applications, set the options for the common libraries to Regenerate-‘Exclude’ and NOT Build Now (unchecked) Building the applications in this fashion will substantially reduce build times.

Download the sample PowerGen project that builds two PFC-based applications. You may open the project with PowerGen, although the paths may not match your installation.