punits Manual

What is punits?

punits is a unit conversion program, complete with its own language used to define units. That just about sums it up. You can use the two units already defined, or you can write your own script. See below for details on writing your own units.

Where can I get punits?

punits source code can be downloaded from http://sf.net/projects/punits/

Defining Units

The language used to define units is very limited. Currently, there are only 13 commands you can use in your script. The syntax is very simple, so defining units isn't very hard. The command character resides in the first column, then a space and the argument (if the command requires). The command characters are:

Let's see a real script:

n metres
o inches

* 39.37

/ 39.37

The first line sets the input type to metres; the second sets the ouput type to inches. The third line begins the algorithm for forward (metres to inches). The fourth sets the buffer equal to the input. The fifth multiplies the buffer by 39.37. The sixth returns with the output stored in the buffer.

The seventh line begins the algorithm for backward (inches to metres). The eighth sets the buffer equal to the input. The ninth divides the buffer by 39.37. The tenth returns with the output in the buffer.

Contact Information

If you would like to contact me regarding punits, please feel free to email me at mokomull@users.sourceforge.net. Please include "punits" in the subject line, as I frequently delete masses of emails from that mailbox. I can also be contacted over AOL Instant Messenger; my screenname is MokoMull.

Author Information

punits was written and is currently being developed by Matt Mullins. punits is distributed under the GPL General Public License.

punits is copyrighted © 2003 Matt Mullins, all rights reserved.

SourceForge.net Logo