**PopUp Calculator 1.0.1**

If you ever tried to do a simple calculation while working with some other application, then you know how it can be boring **–** start calculator, do a calculation, tap on the *“Applications”* button, start again your application and go to the point where you stopped.

With **PopUp Calculator**, doing a calculation *“on the fly”* is like a breeze.

### Overview:

It is a **HackMaster** extension which pops up a calculator over the active application. It is activated with the simple pen stroke. When you are finished with calculation, you are back to your application with just one tap. You can exchange data with your application if it supports copy and paste.

#### Other features:

- Calculator can be moved on the screen.
- Easy toggle between three calculator sizes (small, medium and large).
- Supports standard arithmetic, trigonometric and exponential calculations.

#### RPN PopUp Calculator 1.0.1

It is a **HackMaster extension** which pops up a calculator over the active application. It is activated with the simple *(definable)* pen stroke. When you are finished with calculation, you are back to your application with just one tap. You can exchange data with your application if it supports *copy and paste,* or if it has an input field. Numbers and operations can also be entered with **graffiti.**

RPN PopUp Calculator is compatible with OS 2.0 and later. It will not work on older *(Pilot 1000/5000 with OS 1.x)* models.

RPN PopUp Calculator has a simple forth-like script language, so you can write your own functions unlike the normal *PopUp calculator.*

Below are complete instructions, language reference and sample scripts which can help you achieve this. The informaton is arranged step by step from the

initial step of installation.

### Installation

*This archive contains the following files:*

Readme.htm |
This document |

RpnPopCalc.prc |
Program file |

Scripts.txt |
Example scripts in the simple text form, so you can copy them to the Palm desktop application. After the HotSync, you’ll get them on your Palm device. |

RPNCalculatorSSta.prc |
MagicTextplug-in for activating RPN PopUp Calculator |

Mathlib.prc |
Floating point library needed for trig. and exp functions and for RPN PopUp Calculator scripts. |

Hackmastr.prc |
The “HackMaster” System Extensions Manager. “HackMaster” is by Edward Keyes, DaggerWare Software. |

After installing **RpnPopCalc.prc**, start *“HackMaster”* and click on its checkbox to activate it. After that, RPN PopUp Calculator can be started with the pen stroke defined in the setup below.

**Before updating or deleting any Hackmaster program, you must disable the application first in the “HackMaster” control screen.**

#### Setup

Start *“HackMaster”* and tap on the **+** icon associated with RPN PopUp Calculator.

*Available options:*

*“Pen stroke”***–**the pen stroke which must be used to start PopUp Favorites. For example, if you choose from*“Calc”*to*“Find”,*then you must put the pen on the*“Calculator”*button, drag it to the*“Find”*button, and then lift it.*“Single tap”*and*“Double tap”***–**RPN PopUp Calculator can also be started with the single or double tap on the silk screen button.*“From”*and*“to”*popup triggers**–**choose starting and ending buttons for the activating pen stroke, or choose*“From”*button for a single or double tap activation.

*Known problem:*

If you are very fast with double-tap, it will not work correctly.

### Usage

**–** To exit, tap anywhere outside its window, or use *“Command”* key stroke *(something like “./”, where dot is the starting point of the stroke).*

**–** Digits and operations are entered by tapping on the buttons or with graffiti.

**–** *“Backspace”* graffiti pen stroke erases last entered digit.

**–** To add an exponent to a number tap on the *‘EEX’* button, or first write *‘E’* or *‘e’* with graffiti and then enter exponent digits. To change exponent sign, tap on the *‘+/-‘* button.

**–** You can move RPN PopUp Calculator on the screen to the position where you like. To do that, put the pen on the number display *(above the horizontal line)*

and drag it to the point where you want upper left upper corner to be placed.

#### Buttons

*‘USER’* **–** Shows a list of available user functions which must be located in the *‘RpnPopCalc’* MemoPad category.

*‘TRIG’* **–** Shows a list of trigonometric functions. With *‘Deg’* and *‘Rad’* you choose *‘Degrees’* or *‘Radians’* mode.

*‘EXP’* **–** Shows a list of exponential functions.

*‘COPY’* **–** Copies displayed number to the clipboard. However, if your active application has an input field which has a focus *(ie. cursor is blinking in it),* then you can start RPN PopUpCalc, do some calculation and after you tap on the *‘COPY’* button, RPN PopUpCalc will exit and the last displayed number will be inserted into the field, at the cursor position. That way, RPN PopUpCalc can also serve as a numeric keypad.

*‘PASTE’* **–** You can select a text in the field before starting RPN PopUpCalc – it will interpret selected text *(execute it as a script)* and display the result. See the Language Reference *(Below)* for details.

RPN PopUp Calculator Script Language Reference

RPN PopUp Calculator script is a series of commands and/or functions written in a simple text form using **MemoPad** application. The first step is to create a *‘RpnPopCalc’* MemoPad category. Each script is stored in its own record.

The first line of the script should contain the *‘#'(this can be found at the bottom of this post)* character followed by the function name. That name *(without the ‘#’ character)* will be displayed in the popup list you get when you tap on the *‘USER’* button.

Each command or function can be written on its own line, or on the same line but delimited with the space character. However, there are some exceptions. Please see the note *(at the bottom of the article)* for details.

#### Note

:

‘#’, ‘?’, ‘!’, ‘:’ and ‘@’ commands must be placed as the last commands on the line.

Some examples:

#This is a comment | correct |

DUP 3 ROLL SWAP #Another comment | correct |

#Comment SWAP DUP | incorrect |

@15 | correct |

SWAP 3 > @15 | correct |

@15 DUP | incorrect |

To use scripts bellow, copy each script to a separate MemoPad record in the “RpnPopCalc” category using Palm Desktop application, and then just do a

HotSync.

**Script example 1:**

**
**This script calculates box volume.

#Box volume

?Box length:

?Box width:

?Box height:

* *

!Box volume is:

**Script example 2:**

**
**This script compares all numbers on the stack and returns the largest number.

#Max

:1

DEPTH

1 >

@2

END

:2

DUP

3 ROLL

DUP

3 ROLL

<

@3

SWAP

:3

DROP

#An example for unconditional jump

#Just put a non-zero number on the stack and invoke a jump

1

@1

**Script example 3:**

This function calculates the factoriel of a number. Because RPN PopUp Calculator interprets the script, it can be quite slow. One of our plans for the

future is to make a special script editor/compiler, so scripts will be executed much faster.

#Factoriel

?Number:

INT DUP 2 >=

@1

DROP 1 1

@3

:1

DUP

:4

1 –

DUP

2 <

@2

DUP

3 ROLL * SWAP

1 @4

:2

DROP

:3

!The result is:

*Script example 4:*

This script calculates monthly payment given present value, annual interest rate, number of payment periods, future value and payment type (0 – payments

are due at the end of the period, 1 – payments are due at the beginning of the period. This function works exactly like MS Excel PMT() function.

#PMT (Payment)

?Present value:

0 STO DROP

?Future value:

1 STO DROP

?Annual interest rate (%):

1200 / 2 STO DROP

?Number of payment periods:

3 STO DROP

?Payment type (0/1):

#0=at the end of period

#1=at the beginning of period

4 STO DROP

2 RCL

0 =

@1

1

2 RCL +

3 RCL POW

5 STO

0 RCL * 1 RCL +

1 2 RCL 4 RCL * +

5 RCL 1 –

2 RCL /

*

1

@2

:1

0 RCL

1 RCL

+

3 RCL

:2

/

2 ROUND

CHS

!Monthly payment is:

*Click here to go to the next article about* Application Installation, Usage and Launcher III.