About OrcaScript

OrcaScript allows you to write batch scripts to process PocketBuilder applications and files without using the PocketBuilder development environment. You can use OrcaScript to get the latest version of a PowerScript target from source control, build the target PKLs, and compile and deploy PocketBuilder executable files—all without operator intervention.

OrcaScript uses the Sybase ORCA software to access PocketBuilder library functions without a visual user interface. ORCA library source and header files, the ORCA User’s Guide in PDF format, and a customer license agreement are installed in the PocketBuilder\Support\ORCA directory. None of these files is required to use OrcaScript.

Using OrcaScript with source control

The targets you obtain from source control using OrcaScript could be placed on a network build machine that is shared by PocketBuilder developers. This is especially advantageous for large shops with fixed working hours: the builds could be done nightly by running an OrcaScript batch file, and an up-to-date version of the targets and libraries would be available at the start of the next work day.

Developers could then use OrcaScript or operating system commands to copy the shared files directly to their local machines. Although developers would still connect directly to source control from their local workspaces, refreshing the targets in the workspaces would be much faster since compilation times for complex PowerScript targets would be greatly minimized.

Batch file order

If you include OrcaScript commands in a batch file, the file is read line by line. Each OrcaScript batch file must begin with a start session command and end with an end session command. You can save the batch file with any extension. You run the batch file by calling the OrcaScript executable on a command line and passing the batch file name as an argument:

pkorca25 myOrcaBat.dat

If you use relative directories in the OrcaScript batch file, the directories are relative to the working directories of the DOS shell. Typically, it is a good idea to put the OrcaScript batch file in the directory that contains the PKT file for the target you want to refresh, and to make this the current working directory before launching OrcaScript using the batch file.

Table C-1lists parameters you can use when you call the OrcaScript executable from a command line.

Table C-1: Command line parameters you can use with OrcaScript

Parameter

Description

Example

/D

Sets variables that are valid in the batch file

pkorca25 /D myVar1=value1 /D myVar2=value2 myOrca.dat

/H or /?

Prints syntax help to screen

pkorca25 /H

NoteCaution You should not run an OrcaScript batch file if PocketBuilder is currently running on the same machine. If the PocketBuilder development environment is not shut down while OrcaScript is running, your PocketBuilder libraries can become corrupted. For this reason, casual use of OrcaScript is not recommended.

Error handling

Each line of an OrcaScript batch file either succeeds or fails. If a command fails, subsequent commands are not processed and the OrcaScript session is ended. An error message is printed to the command window.