# About OplTran

## Contents

- Overview
- Example

## Overview

`OplTran` is a command-line utility which enables OPL developers to translate OPL modules into `.opo` or `.app` files on a PC. The output files are implementation-independent; they will run both on the EPOC Emulator and may also be copied to a target EPOC machine, and run from there.

`opltran` is invoked using a batch file, `opltran.bat`, which is installed in directory `\epoc32\tools`. It is recommended that directory `\epoc32\tools` be added to your path if it is not there already. You may run `opltran.bat` by typing `opltran` at the command prompt from any directory.

## Example

An OPL program may be translated in one of two ways. If it was written using the `Program` text editor on either the EPOC Emulator, or an EPOC machine, it may be translated by tapping the "`Tran`" button on `Program`'s toolbar menu. If it was written using the above methods, or using any PC-based text editor, translate it using `opltran`.

For example, assuming that the OPL SDK, and `opltran` have been installed on drive `h:`, translate the program `ophello.opl` by typing the following at the command prompt from any directory on drive `h:`

        opltran h:\epoc32ex\opl\ophello -oh:\epoc32\wins\c\opl\hello

This translates `ophello.opl` (the `.opl` extension is added automatically), creates target directory `hello` and generates the output file `ophello.opo` in `hello`. The `.opo` program may be run from the EPOC Emulator. To invoke the emulator, run the program `\epoc32\release\wins\deb\epoc.exe`. `ophello.opo` is located in folder `c:\opl\hello\`. It may also be copied to an appropriate directory on an EPOC machine using a program such as EPOC Connect, and run from there.

The example program can also be translated using `bldhello.bat` from directory `\epoc32ex\opl\`.

        bldhello ophello