Sample PowerGen Scripts

PowerGen functions can be scripted, since they are available from the command line. The running of the script is accomplished with whatever script or batch processor is available to you. The common processor across all Windows platforms is the "DOS Batch Processor", which runs from a DOS window, but any processor which can invoke command line Windows programs can be used. The examples below use DOS Batch syntax. Scripts can become as extensive as you want, mixing PowerGen (PowerBuilder) operations with other programs, compiling a C++ program for example. Using PowerGen scripts will save enormous amounts of time and tedium. Using them you can reduce what is typically several pages of check list steps to a single, schedulable batch operation.

PLEASE NOTE: Scripts submitted by customers are intended as examples and are not supported. Please do not contact these customers with support questions.


SCRIPT 1: BUILD THE CREATIVE.GEN PROJECT AND REPORT ITS SUCCESS OR FAILURE Developer: E. Crane Computing

In the project, the file CREATIVE.ERR has been specified as the project error file. Note that, for readability, the fully qualified path names have not been used. Download BUILD.BAT.


SCRIPT 2: COPY PBL'S FROM DEVELOPMENT AREA TO BUILD AREA; IF SUCCESSFUL, PERFORMS THE BUILD AND THEN COPIES EXE & PBL'S TO A TEST AREA Developer: E. Crane Computing For the first copy, the PowerGen copy function is used since it will remove object registration information. In the second copy, a Windows copy is used since we are copy PBD’s and EXE’s; the PowerGen copy only copies PBLs. Download COPYPBLS.BAT.


SCRIPT 3: SYNCHRONIZE YOUR APPLICATION FROM VISUAL SOURCE SAFE Developer: E. Crane Computing This script synchronizes a set of master PBLs from objects in the source control system. First it copies a set of existing PBLs from a master work area. Then it deletes any residual source objects in the source area. It gets the objects from the source control system. In this example the source control system is Visual SourceSafe which has a “Get” command line to retrieve sources associated with this project. Then PowerGen performs a Synchronize function using PBG files that have been specified with the project, CREATIVE.GEN. When this is completed a complete build so performed. If successful the resulting PBLs are copies back to the master area and the resulting deliverables are copies to a test area. Download SYNC.BAT.


SCRIPT 4 (two scripts): AUTOMATE THE BUILD PROCESS; MIGRATE FROM PB6.5 TO PB8.0 Developer: Kenneth Frohne, Universal Studios Group - Information Technology Services These scripts include a WinBatch script to automate the build process, as well as the batch file used to migrate the application from PB 6.5 to PB 8.0 Download BUILDSCRIPTS.ZIP.


SCRIPT 5: SYNCHRONIZE YOUR APPLICATION FROM CLEARCASE Developer: Robert Craig, Northrop Grumman Information Technology This script helps PowerBuilder developers refresh their PBLs and PBGs when synchronizing PowerGen from Clearcase. Download SAMPLE_PGEN_BAT.ZIP.


SCRIPT 6: BOOTSTRAP IMPORT YOUR APPLICATION FROM PVCS Developer: The "guys" at Daniel Systems Australia These Scripts “Get” objects from PVCS based on a version label and then create new application PBLs from them using PowerGen’s Bootstrap Import function. Download PVCSIMPORT.ZIP..


SCRIPT 7: BOOTSTRAP IMPORT YOUR APPLICATION FROM HARVEST Developer: Don Gerow, State of New Hampshire This script performs a "check out for browse" from Harvest, creates new PBLs from the checked out objects and then builds the application. Download HarvestImport.ZIP..


SCRIPT 8: BOOTSTRAP IMPORT YOUR APPLICATION FROM VISUAL SOURCE SAFE Developer: Barry from Electric Lightwave This script performs a "check out " from Visual Source Safe, creates new PBLs from the checked out objects and then builds the application. Download Script (elic_build.zip).


SCRIPT 9: TFS BUILD SCRIPT Developer: Chris Painter http://blog.deploymentengineering.com This is an example of incrementally building TestApp ( generated by PB8 Application wizard ) using Team Foundation Build. Download TestAppTFSBuildExample.zip.