This is only a list of what Bosch Calculator for Android does:
 
Distance convertions:
Please do not forget Millimeter, centimeter, Meter, Kilometer
Yard, foot, zoll (inch?)
Miles to Kilometer
 
Speed:
km/h, mph, m/s, kn
 
Wind Strength:
km/h, Bft,
 
Pressure:
bar, Pa, kPa, mWs, inWC, atm
 
Power:
W, PS (lmp), kW, MW
 
Square:
m2, km2, cm2, mm2, mi2, yd2 ft2, in2
 
weight:
gramm, Kilogramm, lb, oz etc.

Volume convertions:
Please do not forget Centiliter, Liter, maybe Hektoliter (=100 Liter)
m3, ft3, in3, Liter, deciliter, centiliter, milliliter, gal (lmp), pt (lmp), fl oz (lmp)
 
Some more:
MPG (Miles per gallon) to l/100km (Liter per 100 km)
 
 
 
Sent: Saturday, September 14, 2024 at 4:59 AM
From: "Paul Dufresne via Freedos-devel" <freedos-devel@lists.sourceforge.net>
To: "freedos-devel" <freedos-devel@lists.sourceforge.net>
Cc: "Paul Dufresne" <dufres...@zoho.com>
Subject: [Freedos-devel] a unit converter program in REXX... probably not working under DOS yet
It began when I did read:
https://bttr-software.de/forum/board_entry.php?id=22023

I then did read:
https://sourceforge.net/projects/regina-rexx/files/regina-documentation/3.9.6/

Learn also about:
https://www.oorexx.org/

Also https://en.wikipedia.org/wiki/Rexx obviously.

Rexx is an easy to read and learn programming language... but as it is not popular... have almost no GUI libraries...
oorexx have a GTK v.2 binding ... a complete ncurses binding... regina rexx have very limited gotoxy and read char at xy.

Anyway, I wrote a small program to convert units ... it is using a bit sophisticated stuff... making it sadly probably not usable for DOS as is.

It just beginning to work... but I like to share soon as I am unsure if I will continue to work on it...
The style I believe make it very easy to extend... I hope.

I wrote it in unitsv1.rex file... and call it with regina unitsv1.rex

I have installed on Fedora 40:
regina-rexx.x86_64 : Regina Rexx Interpreter
regina-rexx-doc.noarch : Documentation for regina-rexx
regina-rexx-libs.x86_64 : Shared libraries for regina-rexx

So here it is:

/*
Copyright 2024 Paul Dufresne (dufres...@zoho.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


-- The following 2 calls are for loading regutil library
-- it is needed only for regStemDoOver
-- to work, program must be called with regina rather than rexx
-- Because of this, it is believe the program cannot run under DOS
call RxFuncAdd 'sysloadfuncs', 'regutil', 'sysloadfuncs'
call sysloadfuncs

menu. = 'not there!' -- default value

menu.top.name='Conversions'
menu.top.1='distance'
menu.top.1.proc='showMenuDistance'
menu.top.2='weight'
menu.top.2.proc='showMenuWeight'
menu.top.3='temperature'
menu.top.3.proc='showMenuTemperature'
menu.top.4='volume'
menu.top.4.proc='showMenuVolume'
menu.top.5='END'
menu.top.back='bye'

menu.distance.name='Distance convertions'
menu.distance.1='centimeters to inch'
menu.distance.1.proc="doSomeConversions 'centimeters','inches',centis2inches"
menu.distance.2='inches to centimeters'
menu.distance.2.proc="doSomeConversions 'inches','centimeters',inches2centis"
menu.distance.3='END'
menu.distance.back='doMenu top'

menu.weight.name='Weight convertions'
menu.weight.1='pounds to kilograms'
menu.weight.1.proc="doSomeConversions 'pounds','kilos',pounds2kilos"
menu.weight.2='kilograms to pounds'
menu.weight.2.proc="doSomeConversions 'kilos','pounds',kilos2pounds"
menu.weight.3='END'
menu.weight.back='doMenu top'

menu.temp.name='Temperature convertions'
menu.temp.1='farenheits to celsius'
menu.temp.1.proc="doSomeConversions 'farenheits','celsius',farens2celsius"
menu.temp.2='celsius to farenheits'
menu.temp.2.proc="doSomeConversions 'celsius','farenheits',celsius2farens"
menu.temp.3='END'
menu.temp.back='doMenu top'

menu.vol.name='Volume convertions'
menu.vol.1='gallons to cube meters'
menu.vol.1.proc="doSomeConversions 'gallons','cube meters',gallons2cubemeters"
menu.vol.2='cube meters to gallons'
menu.vol.2.proc="doSomeConversions 'cube meters','gallons',cubemeters2gallons"
menu.vol.3='END'
menu.vol.back='doMenu top'

call doMenu 'TOP'
exit 0

doMenu:
drop mymenu.
do while regstemdoover('menu.','i')
if index(i,arg(1)) then do
j=substr(i, index(i,'.')+1)
mymenu.j=menu.i
end
end
--call sysdumpvariables
say mymenu.name
i=1
do until mymenu.i == 'END'
say i'. 'mymenu.i
i=i+1
if i==14 then exit -- was added as a debug thing at the beginning... should probably be removed
end
pull choice
--say 'choice.proc='mymenu.choice.proc
--interpret "call "mymenu.choice.proc" "
if choice=='' | choice=='Q' | choice=='QUIT'
then interpret "call "mymenu.back
else interpret "call "mymenu.choice.proc
exit 888 -- not expected to happen because mymenu.back call Bye

showMenuDistance:
call doMenu 'DISTANCE'
exit

showMenuWeight:
call doMenu 'WEIGHT'
exit

showMenuTemperature:
call doMenu 'TEMP'
exit

showMenuVolume:
call doMenu 'VOL'
exit

centis2inches:
return arg(1)/2.54

inches2centis:
return arg(1)*2.54

pounds2kilos:
return arg(1)/2.18

kilos2pounds:
return arg(1)*2.18

farens2celsius:
return (arg(1)-32)*5/9

celsius2farens:
return (arg(1)*9/5)+32

gallons2cubemeters:
return arg(1)*0.00378541

cubemeters2gallons:
return arg(1)/0.00378541

doSomeConversions:
fini = 0
do until fini
Say 'Number of 'arg(1)':'
pull originUnits
if originUnits <> '' & originUnits <> 'END' & originUnits <> 'Q' & originUnits<>'QUIT' then do
--say 'call 'arg(3)' 'orginUnits
interpret 'call 'arg(3)' 'originUnits
Say 'give 'RESULT' 'arg(2)
Say
end
else fini=1
end
--say mymenu.back
interpret "call "mymenu.back
exit 999

bye:
say 'Goodbye!'
exit 0





_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to