Conversions Script
Webb - all rights reserved - ©2004
spacer
Author - David Winslow
Email: dwinslow@databeam.com
Webpage:

Summary: Temp, Dist, Cooking and FOUR NEW categores. 442 conversion in
all.

Instructions: There are nine function sets: Conversions, Dist,
Rate, Time, Area, Temp, Mass, Cook and XXXX.
Conversions is the main menu - you can easily get
to the other function sets from  this function
set.

XXXX is a "Template" function set for you to add
your own categories to the main menu. There are
five main menu spots left. Send me a mail if you
add some categories to the main menu -- I'ld  
like to see them.

Press [M] to get back to the main menu from each
of the sub-menus. Press [?] for help on each of
the sub-menus. Press [C] to clear the stack and
reset the 'from'/'to' mode.

In 'Help' mode, pressing a unit abbreviation will
spell out what that unit is. Visit this great WEB
site for everything you want to know about
converting from any Unit to any other Unit.
I took much information from this site.

http://www.unc.edu/~rowlett/units/index.html

Currently, there are 442 conversions possible.

Here are the menus and how to use them:

-------------------    Just tap a button!
|    Conversions    |   'XXXX' are free
|Dist Rate Time Area|   category spots -
|Temp Mass Cook XXXX|   see the template and
|XXXX XXXX XXXX XXXX|   make up your OWN !
-------------------

If you fill up an empty spot, drop me a line with
your function set and I may add your function set
here giving appropriate credit to you!

-----------------      72 conversions
| [Dist] [C]  [?] |     possible. e.g. -
| mm cm m  km fur |     60 mi km converts
| in ft yd mi [M] |     60 miles to 96.56
-----------------      kilometers.

The meter (m) is the International System of
Weights and Measures (french abbr. SIPM or SI for
short) fundamental unit for distance.

Don't know what 'fur' stands for? Go into 'Help'
mode and tap 'fur'. Then, visit the WEB site
mentioned above to read about the history of
the furlong.

--------------------   42 conversions
| [Rate]   [C]   [?] |  possible. e.g. -
| in/s f/s mi/h f/FN |  60 mi/h f/FN converts
| cm/s m/s km/h [M]  |  60 miles per hour to
--------------------   161280 furlongs per
                        fortnight!

Meters per second (m/s) is the SI approved unit
for measuring rate.

The "real" abbr. for furlongs is 'fur' but space
considerations dictated the use of 'f' instead
of 'fur'. Don't ask me why I put furlongs and
fornights into the program.

------------------     56 conversions
| [Time] [C]   [?] |    possible. e.g. -
|  s  min  hr   d  |    1 yr d converts
| wk FN  mo yr [M] |    1 tropical year
------------------     to 365.24 days.

Seconds (s) is the SI fundamental unit for time.

FN is my own abbreviation for fortnight since
there is no official one. Time is tricky. A year
can be 365 or 366 days. A month can range from
28 to 31 days. But, a "tropical year" can be
converted exactly as well as a "synodic month".

-------------------    90 conversions
| [Area]  [C]   [?] |   possible. e.g. -
|  mm\178  cm\178  m\178  km\178 |   1 ha A converts
|  ha  in\178  ft\178 yd\178 |   1 hectare to 2.47
|  mi\178    A     [M] |   Acres.
-------------------   

Square meters (m\178) is the SI approved unit for
measuring area.

The Hectare (ha) is the metric equivalent of the Acre (A).

----------------       20 conversions
| [Temp] [C] [?] |      possible. e.g. -
|  \176F   \176C  \176K  |      212 \176F \176Ra converts
|  \176Ra  \176Re  [M] |      212 degrees Farenheit
----------------       to 671.67 degrees Rankine

Degrees Kelvin (\176K) is the SI fundamental unit for
temperature.

Note: This sequence 212 \176F \176C \176C \176K \176K \176Ra \176Ra \176Re
will show the boiling point for all the scales on
the stack.

For information on Celsius, Farenheit, Kelvin,
Rankine and Reaumur scales please see:

http://www.cchem.berkeley.edu/ChemResources/
temperature.html

-------------------    90 conversions
| [Mass]  [C]   [?] |   possible. e.g. -
|  mg   ct   g   kg |   1 tS pd converts
|  tn   oz oz t  pd |   1 short ton to
|   tL    tS    [M] |   2000 pounds.
-------------------    tS is the American ton.

The kilogram (kg) is the SI fundamental unit for
mass.

'tn' is the metric tonne. 1 tn = 1000 kg
'tL' is the British long ton.
'oz t' is the troy ounce, traditionally used in
pharmacy and jewelry while 'oz' is the
avoirdupois ounce.
'ct' is the metric carat defined in 1907 to be
exactly 200 milligrams.

---------------------  72 conversions
| [Cook]   [C]   [?]  | possible. e.g. -
|  tsp    tbsp  fl oz | 1 tbsp ml converts
|  c   pt    qt  gal  | 1 tablespoon to
|  ml     l     [M]   | 14.789 mililiters.
---------------------

Liters (l) is the SI approved unit for measuring
volumn.

'fl oz' is the fluid ounce. It is a traditional
unit of liquid volume, called the fluid ounce to
avoid confusion with the weight ounce. In the
U. S. customary system there are 16 fluid ounces
in a pint, so each fluid ounce represents
1.804 687 cubic inches or 29.573 531 milliliters.
In the British imperial system there are 20 fluid
ounces in an imperial pint, so each fluid ounce
represents about 1.733 871 cubic inches or
28.413 063 milliliters. A fluid ounce of water
weighs just a bit more than one ounce
avoirdupois.

for the above, thanks to:
http://www.unc.edu/~rowlett/units/index.html


Code:

RPN.2.a+8 \ Conversions
"Conversions"
"Conversions" D'Conversions\Copyright 1999 by\D. Winslow'd1;
~
"Dist" G'Dist';
"Rate" G'Rate';
"Time" G'Time';
"Area" G'Area';
~
"Temp" G'Temp';
"Mass" G'Mass';
"Cook" G'Cook';
"XXXX" G'XXXX';
~
"XXXX" G'XXXX';
"XXXX" G'XXXX';
"XXXX" G'XXXX';
"XXXX" G'XXXX';
=================================================
RPN.2.c+3 \ Dist
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[i] c(xa#'25.4'/:xa#'2.54'/:
xa#'.0254'/:xa#'.0000254'/:xa#'7920'*:xa:xam12:xam36: xa#'63360'*);
[c] c( xa#'10'/:xa:xa#'100'*:xa#'100000'*:xa#'7920'*Cb:xaCb:
xam12Cb:xam36Cb: xa#'63360.'*Cb);

[b] #'2.54'*;

"Dist"

"[Dist]" D'Dist\Copyright 1999 by\D. Winslow'd1;
"[C]: clear/reset" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any distance.\Convert to any other
distance.';
~
"mm: milimeters" Cs1=0(Xa0Xcxa:xcCcm10);
"cm: centimeters" Cs1=0(Xa1Xcxa:xcCc);
"m: meters"  Cs1=0(Xa2Xcxa:xcCc#'100'/);
"km: kilometers" Cs1=0(Xa3Xcxa:xcCc#'100000'/);
"fur: furlongs" Cs1=0(Xa4Xcxa:xcCi#'7920'/);
~
"in: inches" Cs1=0(Xa5Xcxa:xcCi);
"ft: feet" Cs1=0(Xa6Xcxa:xcCi#'12'/);
"yd: yards" Cs1=0(Xa7Xcxa:xcCi #'36'/);
"mi: miles" Cs1=0(Xa#'99'Xcxa:xcCi#'63360'/);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Area
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[m] c(xa#'.000001'*:xa#'.0001'*:xa:xa#'1000000'*: xa#'10000'*:
xa#'.00064516'*:xa#'.09290304'*:xa#'.83612736'*:xa#'2589988.110336'*:  
xa#'4046.8564224'*);

"Area"

"[Area]" D'Area\Copyright 1999 by\D. Winslow'd1;
"[C]: clear \reset" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any area.\Convert to any other area.';
~
"mm\178: square milimeters" Cs1=0(Xa0Xcxa:xcCm#'.000001'/);
"cm\178: square centimeters" Cs1=0(Xa1Xcxa:xcCm#'.0001'/);
"m\178: square meters" Cs1=0(Xa2Xcxa:xcCm);
"km\178: square kilometers" Cs1=0(Xa3Xcxa:xcCm#'1000000'/);
~
"ha: hectares" Cs1=0(Xa4Xcxa:xcCm#'10000'/);
"in\178: square inchej" Cs1=0(Xa5Xcxa:xcCm#'.00064516'/);
"ft\178: square feet" Cs1=0(Xa6Xcxa:xcCm#'.09290304'/);
"yd\178: square yards" Cs1=0(Xa7Xcxa:xcCm#'.83612736'/);
~
"mi\178: square miles" Cs1=0(Xa8Xcxa:xcCm#'2589988.110336'/);
"A: Acres" Cs1=0(Xa9Xcxa:xcCm#'4046.8564224'/);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Cook
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[c] #'4.226'*;
[d] #'4.226'/;
[p]
c(xa#'96'/:xa#'32'/:xa#'16'/:xa2/:xa:xa2*:xa8*:xa#'1000'/Cc2/:xaCc2/);


"Cook"

"[Cook]" D'Cook\Copyright 1999 by\D. Winslow'd1;
"[C]: clear \reset" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any liquid volumn.\Convert to any other
liquid volumn.';
~
"tsp: teaspoons" Cs1=0(Xa0Xcxa:xcCpm96);
"tbsp: tablespoons"Cs1=0(Xa1Xcxa:xcCpm32);
"fl oz: fluid ounces" Cs1=0(Xa2Xcxa:xcCpm16);
~
"c: cups"Cs1=0(Xa3Xcxa:xcCp2*);
"pt: pints"Cs1=0(Xa4Xcxa:xcCp);
"qt: quarts"Cs1=0(Xa5Xcxa:xcCp2/);
"gal: gallons"Cs1=0(Xa6Xcxa:xcCp8/);
~
"ml: mililiters" Cs1=0(Xa7Xcxa:xcCp2*Cd#'1000'*);
"l: liters" Cs1=0(Xa#'1000'Xcxa:xcCp2*Cd);
"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Mass
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[k]
c(xa#'.000001'*:xa#'.0002'*:xa#'.001'*:xa:xa#'1000'*:xa#'.028349523125'*:xa#'.0311034768'*:xa#'.45359237'*:xa#'1016.0469088'*:xa#'907.18474'*);


"Mass"

"[Mass]" D'Mass\Copyright 1999 by\D. Winslow'd1;
"[C]: clear \reset" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any mass.\Convert to any other mass.';
~
"mg: miligrams" Cs1=0(Xa0Xcxa:xcCk#'.000001'/);
"ct: metric carat" Cs1=0(Xa1Xcxa:xcCk#'.0002'/);
"g: gram" Cs1=0(Xa2Xcxa:xcCk#'.001'/);
"kg: kilogram" Cs1=0(Xa3Xcxa:xcCk);
~
"tn: metric ton" Cs1=0(Xa4Xcxa:xcCk#'1000'/);
"oz: avoirdupois ounce" Cs1=0(Xa5Xcxa:xcCk#'.028349523125'/);
"oz t: troy ounce" Cs1=0(Xa6Xcxa:xcCk#'.0311034768'/);
"pd: pound" Cs1=0(Xa7Xcxa:xcCk#'.45359237'/);
~
"t L: British long ton" Cs1=0(Xa8Xcxa:xcCk#'1016.0469088'/);
"t S: American short ton" Cs1=0(Xa#'99'Xcxa:xcCk#'907.18474'/);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Rate
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[m] c(xa#'.0254'*:xa#'.3048'*:xa#'.44704'*: xa#'.000166309524'*
:xa#'100'/:xa:xa#'3.6'/);

"Rate"

"[Rate]" D'Rate\Copyright 1999 by\D. Winslow'd1;
"[C]: clear stack\and reset mode" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any speed.\Convert to any other speed.';
~
"in/s: inches per second" Cs1=0(Xa0Xcxa:xcCm#'.0254'/);
"f/s: feet per second" Cs1=0(Xa1Xcxa:xcCm#'.3048'/);
"mi/h: miles per hour" Cs1=0(Xa2Xcxa:xcCm#'.44704'/);
"f/FN: furlongs per fortnight" Cs1=0(Xa3Xcxa:xcCm#'.000166309524'/);
~
"cm/s: centimeters per second" Cs1=0(Xa4Xcxa:xcCm#'100'*);
"m/s: meters per second" Cs1=0(Xa5Xcxa:xcCm);
"km/h: kilometers per hour" Cs1=0(Xa#'99'Xcxa:xcCm#'3.6'*);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Temp
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[k] c(xa#'32'-59/*#'273.15'+ : xa#'273.15'+ :  xa : xa59/* :
xa54/*#'273.15'+);

\K=C+273.15
\K=5/4Re+273.15
\K=5/9Ra
\K=((F-32)5/9)+273.15

"Temp"
"[Temp]" D'Temp\Copyright 1999 by\D. Winslow'd1;
"[C]: clear stack\and reset mode" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any unit.\Convert to any other unit.';
~
"\176F: Farenheit" Cs1=0(Xa0Xcxa:xcCk#'273.15'-95/*#'32'+);
"\176C: Celsius" Cs1=0(Xa1Xcxa:xcCk#'273.15'-);
"\176K: Kelvin" Cs1=0(Xa2Xcxa:xcCk);
~
"\176Ra: Rankine" Cs1=0(Xa3Xcxa:xcCk95/*);
"\176Re: Reaumur" Cs1=0(Xa#'1000'Xcxa:xcCk#'273.15'-45/*);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ Time
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

[d] c(xa#'86400'/:
xa#'1440'/:xa#'24'/:xa:xa7*:xam14:xa#'29.53059'*:xa#'365.2421987812'*);


"Time"

"[Time]" D'Time\Copyright 1999 by\D. Winslow'd1;
"[C]: clear stack\and reset mode" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any unit.\Convert to any other unit.';
~
"s: seconds" Cs1=0(Xa0Xcxa:xcCd#'86400'*);
"min: minutes" Cs1=0(Xa1Xcxa:xcCd#'1440'*);
"hr: hours"  Cs1=0(Xa2Xcxa:xcCdm24);
"d: days" Cs1=0(Xa3Xcxa:xcCd);
~
"wk: weeks" Cs1=0(Xa4Xcxa:xcCd7/);
"FN: fortnight " Cs1=0(Xa5Xcxa:xcCd#'14'/);
"mo: synodic month" Cs1=0(Xa6Xcxa:xcCd#'29.53059'/);
"yr: tropical year" Cs1=0(Xa#'99'Xcxa:xcCd#'365.2421987812'/);

"[M]: -> main Menu" G 'Conversions';
=================================================
RPN.2.c+4 \ XXXX
\
\ Make your own! Drop me a line.
\

\ Always include sub 's'
\ checks 'b' - if 1, returns 1 and stores
\ 2 in b - if 2, returns 2 and stores 1 in b
\
[s] xb1=0(2Xb1:xb2=0(1Xb2:2Xb1));

\
\ to Unit 2 (in memory 'a') from
\
[x] c(
xa#'123'*: \ Unit 1
xa: \ Unit 2
xa#'456'/ \ Unit 3
);

\
\ Change XXXX to your category
\
"XXXX"

"[XXXX]" D'XXXX\Copyright 1999 by\Your name'd1;

"[C]: clear \reset" 0Xb{h0=0(B:d1)};
"[?]: Help" D'Enter #.\Press any XXXX\Convert to any other XXXX.';
~

\
\This part constant- but make
\sure to increment what you put
\in 'c' by 1 for each unit button
\                |
"Unit 1" Cs1=0(Xa0Xcxa:
\
\ Recall the users 'from' choice, 'c'
\ Convert to base unit (unit2) and
\ then back again.
\
xcCx#'123'/);

"Unit 2" Cs1=0(Xa1Xcxa:xcCx);

"Unit 3" Cs1=0(Xa9Xcxa:xcCx#'456'*);
~
"[M]: return to Menu" G 'Conversions';