Archived     (close)   (home)
GalaSoft Laurent Bugnion This page is not maintained anymore, and has been archived. The information on this page must be taken with care, because it might not be valid anymore.
For more information, see this page or contact me
With the compliments of

Visit GalaSoft

Acknowledgements:
Thanx to all the people who sent me advices about this problem, especially Ed Crandell and Rick Wild.

For more info about this specific problem:
Waba workbench

For all kind of info about Waba:
WabaSoft
and the newsgroup
pilot.programmer.waba
@ news.massena.com
Working with Waba and packages

Working with Waba and packages can be a bit difficult when trying to produce the PRC and PDB files (in other words, when using exegen.exe and warp.exe).
The reason is that the "package path" and the "class path" must be specified in the programs' parameters. The syntax is a bit confusing.

Hereunder, the user can find an example using packages, and a customizable batch file under Windows environment, automatizing the process of creation of PRC and PDB files.

Environment:
  • Windows OS (NT, 95, 98...)
  • Waba SDK 1.0
  • PalmPilot OS V3.3
  • (JBuilder 3.00 Pro)
Path:
  • Waba SDK is installed in d:\waba\wabasdk.10
  • The class files are produced in e:\galasoft\myjava\class\galasoftLB\pProjectName\
Packages:
  • All classes belong to a package galasoftLB.pProjectName
    (for example galasoftLB.pTestWaba)
Solution:
  • exegen and warp are copied and executed in e:\galasoft\myjava\class\
  • exegen must be called with: exegen outputFileName packageName.mainClassName warpFileName (here: exegen TestWaba galasoftLB.pTestWaba.TestWaba TestWaba)
  • warp must be called with (windows only): warp c outputFileName packageName\*.class (here: warp c TestWaba galasoftLB\pTestWaba\*.class)
Example:
(Based on WabaSoft's Scribble example)



Java code: package galasoftLB.pTestWaba; import waba.ui.*; import waba.fx.*; public class TestWaba extends MainWindow { int lastX, lastY; Graphics g; Button buttonClear; public TestWaba() { g = new Graphics( this ); buttonClear = new Button( "clear" ); buttonClear.setRect( 0, this.height - 15, 40, 15 ); add( buttonClear ); } public void onEvent( Event evt ) { if ( evt.type == PenEvent.PEN_DOWN ) { PenEvent pe = (PenEvent) evt; lastX = pe.x; lastY = pe.y; } else { if ( evt.type == PenEvent.PEN_DRAG ) { PenEvent pe = (PenEvent) evt; g.drawLine( lastX, lastY, pe.x, pe.y ); lastX = pe.x; lastY = pe.y; } else { if ( evt.type == ControlEvent.PRESSED ) { if ( evt.target == buttonClear ) { this.repaint(); } } } } } }
Creating PRC and PDB, Process:
    1) TestWaba.class is produced in e:\galasoft\myjava\class\galasoftLB\pTestWaba\

    2) exegen.exe and warp.exe are copied from d:\waba\wabasdk.10\bin\ in e:\galasoft\myjava\class\

    3) exegen and warp are called with: exegen TestWaba galasoftLB.pTestWaba.TestWaba TestWaba warp c TestWaba galasoftLB\pTestWaba\*.class 4) TestWaba.prc, TestWaba.lnk, TestWaba.wrp and TestWaba.pdb are produced in e:\galasoft\myjava\class\

    5) TestWaba.lnk and TestWaba.wrp are deleted (not used on PalmPilot platform).

    6) TestWaba.prc and TestWaba.pdb are copied in the working directory for this project.

    7) exegen.exe and warp.exe are deleted from e:\galasoft\myjava\class\

Batch file:
This batch (createprcpdb.bat) file is called in e:\galasoft\myjava\
Syntax: createprcpdb projectName
@echo off cls rem Customize here ----------------------------------------------------- set JAVADIR=e:\galasoft\myjava set BASEPACKAGE=galasoftLB set WABADIR=d:\waba echo ******************************************************************* echo Batch file by GalaSoft Laurent Bugnion echo copyright 2000 echo For more info: www.galasoft.ch echo ******************************************************************* rem Checking environment and parameter --------------------------------- if %1/==/ goto noarg if NOT exist %WABADIR%\wabasdk.10\ goto nowaba if NOT exist %WABADIR%\wabasdk.10\bin\exegen.* goto noexegen if NOT exist %WABADIR%\wabasdk.10\bin\warp.* goto nowarp if NOT exist %JAVADIR%\class\galasoftLB\p%1 goto noclass if NOT exist %JAVADIR%\class\galasoftLB\p%1\%1.class goto noclass echo ******************************************************************* echo * Converting %JAVADIR%\class\p%1\%1.class echo * (and the other classes in this package) echo * in %JAVADIR%\%1\_current\%1.prc echo * and %JAVADIR%\%1\_current\%1.pdb rem Checking output directory for PRC and PDB -------------------------- if exist %JAVADIR%\%1\_current goto direxist echo * echo * Creating output directory %JAVADIR%\%1\_current md %JAVADIR%\%1\_current :direxist rem Copying execs from Waba directory ---------------------------------- echo * echo * Copying executables copy %WABADIR%\wabasdk.10\bin\exegen.exe %JAVADIR%\class copy %WABADIR%\wabasdk.10\bin\warp.exe %JAVADIR%\class rem Change directory to the class dir ---------------------------------- cd class rem Calling exegen and warp, deleting unused output files -------------- echo * echo * Creating PRC exegen %1 %BASEPACKAGE%.p%1.%1 %1 del %1.lnk echo * echo * Creating PDB warp c %1 %BASEPACKAGE%\p%1\*.class del %1.wrp rem Moving output files in output directory ---------------------------- echo * echo * Copying PRC and PDB in output directory if exist %JAVADIR%\%1\_current\%1.prc del %JAVADIR%\%1\_current\%1.prc if exist %JAVADIR%\%1\_current\%1.pdb del %JAVADIR%\%1\_current\%1.pdb move %1.prc %JAVADIR%\%1\_current move %1.pdb %JAVADIR%\%1\_current rem Deleting exegen and warp from working directory -------------------- echo * echo * Deleting executables del exegen.exe del warp.exe goto end rem Different warnings ------------------------------------------------- :nowaba echo Cannot find the WABA SDK goto end :noexegen echo Cannot find %WABADIR%\wabasdk.10\bin\exegen.exe goto end :nowarp echo Cannot find %WABADIR%\wabasdk.10\bin\warp.exe goto end :noclass echo Cannot find %JAVADIR%\class\galasoftLB\p%1\%1.class goto end :noarg echo Syntax must be: echo "createprcpdb [projname]" goto end :end cd %JAVADIR%