JFW Temperature Conversion Scripts
By Andrew Hart

Development History:
12/9/2001:  Official release of Temperature Conversion Scripts for JFW
11/9/2001:  Documentation and packaging tidied up
17/7/2001:  Scripts created

Synopsis:
These scripts will convert temperatures expressed in degrees Celcius to temperatures in
degrees Fahrenheit and vice versa.

System Requirements:

These scripts require JFW Version 3.7 or later.  The scripts should work with JFW Version 4.0 
but, at the time of writing, they have not been tested.

Installation:

1.  Make a backup of your default scripts in the event that these scripts
don't work for you for whatever reason.  I don't see this happening but you
never know.

2.  Using Winzip or some other unzip utility, extract all the files from the .zip archive into 
an empty directory on your hard disk.  You should have the following files:

. readme.txt:  this file
. tempconv.jss:  The JFW Temperature Conversion Script source code

3.  Open up the tempconv.jss file in the JFW Script Manager.  Note, before 
opening up the tempconv.jss file, you might save time if you open the default 
scripts with Ctrl-Shift-0 first because you are going to paste the contents of 
the tempconv.jss on to the end of the default scripts later on.  Then once the 
default scripts are loaded, you can do a Ctrl-o to open up the tempconv.jss 
file, typing in the full name and path to where you put tempconv.jss of course.  
This will put the tempconv.jss file in another document window but you can cycle 
between the default.jss file and the tempconv.jss file with Ctrl-Tab.  

By the way, the default.jss file is the default scripts but you probably knew 
that right?  <grin>

4.  Once you have the tempconv.jss file open and you are focused in that file, 
select all of the text in the file with Ctrl-a and copy this to the clipboard 
with Ctrl-c.

5.  Now Ctrl-Tab to your default.jss file and once focused in the default.jss 
file, go to the end of the file with Ctrl-End.  Then press Enter. This will 
ensure that you will have a blank line between the last script in the 
default.jss file and the temperature scripts which you are going to paste in in 
the next step.

6.  Press Ctrl-v to paste in the contents of the tempconv.jss file which you 
copied to the clipboard in step 4.

7.  Again we now must go to the end of the default.jss file with Ctrl-End and do 
a Shift-F2 to insure you are focused on the script called 
"TemperatureConversions".  JFW should announce this.

8.  Press the Home key to insure you are at the beginning of the line and then 
do a Ctrl-RightArrow to move to the actual script name.

9.  We are now going to copy the script name on to the clipboard because you 
will need this to fill out the script name field in the next step.  This step is 
needed because of a bug in JFW 3.7.  Now do a Ctrl-Shift-RightArrow which will 
then select the script name.  Now do a Shift-LeftArrow to insure that the 
trailing space is not selected. Unfortunately, the select word seems to copy the 
trailing space character and we don't want that in the script name.  Now do a 
Ctrl-c to copy the script name to the clipboard.

10.  Do a DownArrow to insure that you are focused in the TemperatureConversions 
script Then do a Control+d to open up the script document dialogue box.  When 
this opens up, you will be focused on an edit field labelled "script name".  JFW 
should announce this to you.   Press Ctrl-v to paste in the script name that was 
copied to the clipboard in the previous step.

11.  Press Tab again and you will land on a checkbox which asks you if you would 
like to assign this script to a keystroke.  JFW will probably announce "Can be 
attached to Key CheckBox UnChecked".  Make sure you check this checkbox.  Press 
space to check it.

12.  You can tab past the "synopsis", "description" edit fields and the 
"category" combo box.  However, if you feel so inclined, you can fill these 
fields out with the information they request, but not doing so will not affect 
the functionality of these scripts.  If you decide to tab past these fields, 
just tab until you reach the "Assign to hotkey" field.  When JFW announces 
"Assign to hotkey", press the keystroke combination  you want to use to access 
the temperature conversion function.

13.  Tab to the OK button and press Enter or space-bar, it doesn't matter as 
both should work.

14.  When the documentation dialogue closes, you should be focused back in the 
script manager main window in the default.jss file.  Press Ctrl-s to save and 
compile the scripts. If successful, JFW should announce "Compile complete".

15.  Finally, close the Script Manager with Alt-F4 and you can now try the 
scripts with the assigned hotkey.

DEINSTALLATION:

Deinstallation involves reversing all the steps taken during installation.  Briefly, you must do the following:

1.  In the JFW Keyboard Manager, delete the key assignment to the "TemperatureConversions" 
script.
 
2.  Copy your backup of default.jss over the modified version.  Afterwards, open the JFW Script 
Manager by pressing Insert-0.  Then press Ctrl-Shift-d to load default.jss, press Ctrl-s to save and recompile the 
default scripts without the temperature conversion functionality, and then close the Script Manager by pressing Alt-F4.

Usage:

When you press the keystroke combination you assigned to the 
"TemperatureConversions" script during installation, you will be presented with 
a menu and invited to select a direction of conversion, that is, from Celcius to 
Fahrenheit or Fahrenheit to Celcius.  Next, you will be prompted for the 
temperature to convert.  Finally, the conversion is made and the result 
displayed in a message box on screen.

A Note on Accuracy:
The JFW Scripting Language has no facility for performing real arithmetic. 
Hence, these scripts perform all calculations using integer arithmetic.  Due to 
the formula relating degrees Celcius to degrees Fahrenheit, conversions from 
Degrees Celcius to degrees Fahrenheit are always exact.  However, conversions in 
the opposite direction may result in non/recurring decimal numbers which have to 
be truncated.  This is not a problem, as computers are always doing this with 
real numbers, but these scripts perform the truncation based on how many decimal 
places are to the right of the number you input for conversion. The answers 
rendered by these scripts always have one extra decimal place, unless the 
resulting temperature has no fractional part, in which case no decimal part is 
reported.  For example, these scripts will convert 85 degrees Fahrenheit to 29.4 
degrees Celcius or 85.0 degrees Fahrenheit to 29.44 degrees Celcius, etc.  So, 
you may obtain a desired degree of accuracy by adding an appropriate number of 
xzeros to the end of a temperature after the decimal point.  However, you should keep in mind 
the scripts can only cope with temperatures involving a maximum of 9 digits, so it is advisable 
not to exceed this number.

KNOWN BUGS:
. None at time of release.

REPORTING BUGS:
If you find any bugs, please let me know by E-mail at 
andrew@jfwscripts.cjb.net.

ACKNOWLEDGEMENTS:
Thanks go to David Truong who first posed the idea for these scripts and who later wrote the 
installation instructions.  Of course, any errors herein are mine and not his.

DISCLAIMER:
The usual disclaimer applies:  use at own risk and I take no 
responsibility for anything that goes wrong while using these scripts, blah blah 
blah. In addition, feel free to use these scripts for anything you like, 
although occasionally crediting me as the creator would be appreciated and help 
to bolster the ego.  :-)
  