Windows Units	1
Overview	1
The Application	2
Performing a Conversion	2
Entering Formulas	2
Entering Constants	2
Conversion Tabs (how to store conversion results)	2
Copying Conversion Results to Another Application	2
Formatting Conversion Results	2
Data File	2
As Shipped Content	3
Constants (how to add more)	3
Measurements (how to add more)	3
Conversions (how to add more)	3
Comments	4
Formatting	4
Technical Note	4
Windows Units
Overview
	Windows Units is a unit conversion program.  It is designed to convert between units (an example would be converting from feet to meters).  I believe that application is intuitive enough that the reading of these instructions will not be required to use the base functionality.  You may want to read quickly through if you find the program useful so you can get the most out of it.  If you get really lost, send me mail at johnmrsco@aol.com and I'll do what I can.  The application is free, but please send me a quick one-line email at johnmrsco@aol.com listing how you are using the application (work, school, fun) if you find it useful.  Be as detailed as you are comfortable in describing your work.  I would like to know in what settings the application is being used.
I wrote the application in 1997 and I find if very useful.  I recently upgraded the interface and decided to 'release' it to the public.  If you find the program helpful too, please feel free to copy it for others.  Again, it is free.  If you add to the unit database (units.data), please send the additions to me (johnmrsco@aol.com) so I can add them to my copy of units.data.
The data file (units.data) can be corrupted, but other than that, there should be no issues running the application.  The data file and application can be zipped into a file <25kB in size.  There is nothing to install, so you can run the application from a floppy or hard drive.  Simply copy the Windows Units.exe and units.data files into the same directory and you are done.  You may make a shortcut to your desktop if you find that helpful.  All the application extensions (dlls) the program needs should be installed with Windows 98 or greater.  Older versions of Windows may already have the necessary dlls loaded as well.  There is no harm in trying.

Thanks,
John Marasco
The Application
Performing a Conversion 
	First, select a conversion by expanding a measurement category and selecting the units to convert 'from' and the units to convert 'to'.  Most categories as shipped allow multiple choices for the 'to' conversion.  After selecting 'from' and 'to' conversion units, simply type a number or formula into the edit box and the corresponding conversion should show in the result box to the right.
Entering Formulas 
The program supports the entering of numerical formulas.  You can use the standard symbols [+, -, *, /] as well as [^] for powers (i.e. 2^4=16).  In addition you can enter the following functions: (sin, cos, tan, asin, acos, atan, log, ln, abs, sinh, cosh, tanh, sign).  The result of the formula will be converted from the source units to the target units and displayed in the result box to the right.  You may use the Calculator conversion to perform 1:1 conversions (straight calculations).
Entering Constants
Constants can be included in a calculation by typing the name of the constant into the edit box or by selecting the name from the Constants Menu.  The name of the constant must match the text in the units.data file, so the Constants Menu is handy (it is a list of the constants from the units.data file).  You can display the Constants Menu by pressing the up arrow button (the button with the picture of an arrow facing up) below the edit box.
Conversion Tabs (how to store conversion results) 
You may add tabs to the application to perform different conversions or the same conversion using different numbers.  To add tabs, simply right click on any tab (at the top of the window) and select 'Add New Tab' from the menu.  You can also remove and rename tabs using the same right click menu.  You can include a value from another tab in your current conversion by using the Constants Menu, or simply typing the Conversion Tab text into the edit box.
Copying Conversion Results to Another Application
You may copy the conversion results to the Windows Clipboard by pressing the Copy Result button.  Then simply paste the text in whatever application you like (Matlab, Maple, Calculator, Excel, etc...) using standard windows paste mechanism.
Formatting Conversion Results
Conversion results may be formatted in one of three formats with varying degrees of precision.  The formats available are displayed in a combo box above the results output.  A slider bar to the right of the format combo box controls the precision.
Data File
Windows units.data is the data file for the "Windows Units" program.  This file needs to be in the same directory as the application.  You can add additional constants, unit measurements and unit conversions to the file.    The data file is a text file, you may use any text editor (notepad) to edit it.  The instructions appear in the follow sections.
As Shipped Content
The database (units.data) contains data to make over 5,000 unique conversions.  The units presented cover 56 unique measurements plus one set I was unable to identify.  The unidentified units are in the 'Miscellaneous' category.
Constants (how to add more)
Constants can be added to the units.data data file.  The format for constants is:
          Constant Name = {Constant Value} Constant Comments
The curly brackets ({}) around the Constant Value and equal sign are important.  Any text after the closing curly bracket will be ignored.  It's a good place to put the units of the constant. 
Measurements (how to add more)
Measurements (otherwise known as unit categories) are delineated inside square brackets in the data file.  The format is:
          [Measurement]
The square brackets are critical; the text inside is completely variable but cannot contain new line characters or square brackets.  You may add as many new measurements to the data file as you like.  Unit conversions are not calculated between measurements (ex.  Lb force and lb mass). 
Conversions (how to add more)
The format for unit conversions is:
          Unit1 = (slope) Unit2 + (offset)
where the slope and offset are of the line equation that will convert from Unit2 to Unit1.  Entering the parenthesis (all four of them, two sets), equal and plus signs are important.  The program will not read the data correctly if any of these items are missing.  Extra spaces or tabs in the equation will not make any difference.  You may use spaces and/or tabs to format the data if you wish.
Conversion Limitations
This program will not do non-linear conversions.
Conversion 'Extras'
The converse of the conversion will automatically be included in the database (when it is assembled in memory from the units.data file); there is no need to enter it.  In addition, the program will compute derived conversions.  As an example, if you entered the two conversions from mm to m and m to km, the program would include the following conversions:
mm
to
m
mm
to
km
m
to
mm
m
to
km
km
to
m
km
to
mm
Note on 'Derived' Conversions
Derived conversions will be slightly less accurate than direct conversions.  As such they are marked as derived conversions in the conversion "to" list.  If the resulting accuracy is insufficient, you may add the conversion directly to the units.data.  For the prior example, you would enter the conversion for mm to km if the derived conversion were insufficiently accurate.
Comments
'#' delineate comments.  You may enter comments anywhere you like.  Each comment line must be proceeded by a '#' sign though.  There are no provisions to mark comment blocks (aka K&R C).
Formatting 
The units.data file shipped with the application was edited using MSVC++ 6.0.  The formatting may not look as 'clean' using others text editors.  Every thing lines up in MSVC++ 6.0 using a tab size of 4, trust me! ;)
Technical Note
  This program was written using MSVC++ (ver 2.0 thru 6.0) and MFC.  There are ~1800 lines of source code for the application.
