                            Notepad 48 1.2b
                           Front End for TED
                             Library 1212
                            By Eric Rechlin
                          rechlin@btigate.com
                        rechlin@sendit.nodak.edu

======================================================================

INTRODUCTION

Notepad 48 is a front end for the TED editor which has a graphical 
menu to select files to open, delete, transfer to another calculator 
or computer, and more.  For convenience, all files created in Notepad 
48 are saved in one file--data.npx--which is stored in port 0.

======================================================================

INSTALLING THE LIBRARY

You must first have a working copy of TED installed.  This also 
requires the Universal Font Library (UFL).  TED can be obtained from:
http://www.hut.fi/~mheiskan/
and UFL can be obtained from:
http://www.engr.uvic.ca/~aschoorl/ufl/

Or, go to my HP48 Archive site at http://hp48.ml.org to download these 
or many more programs.

Now you may install the Notepad 48 library as you would any other 
library:

1. Send NP48.LIB to your calculator in binary mode.
2. Press the softkey corresponding to the variable in which NP48 is 
   stored (NP48.LIB).
3. Enter the port number you want NP48 installed to.  This is usually 
   port 0.
4. Turn your HP off and then back on again.
5. NP48 is now installed and in your library menu, attached to the 
   HOME directory.

======================================================================

USING THE LIBRARY

Notepad 48 1.2 creates a file named DATA.NPX in port 0.  This file 
stores everything that is typed and saved in Notepad 48 1.2.  This 
way, Notepad 48 1.2 can be run from any directory and will still get 
its data.

Notepad 48 1.0, aka Notepad 48 Light, creates a variable named 
DATA.NPX in the current directory.  Because this variable stores 
everything that is typed and saved in Notepad 48, it is recommended 
that you always run Notepad 48 1.0 from the same directory.  To do 
this, I created a variable with the contents: << NP48 >> in the folder
that I always run Notepad 48 (NP48) from.  

When you run NP48, an opening screen comes up with a menu of the most 
used options.  They are NEW, EDIT, DEL, REN, and EXIT, to create a new
file, open and edit an existing file, delete an existing file, rename 
an existing file, and to exit NP48, respectively.  You may also exit 
Notepad 48 by pressing Backspace or ON/CANCEL/ATTN.  Pressing NXT will
display a second menu with I/O options.  They are IR TX, IR RX, BCKUP,
REST, and EXIT, to transfer a file over infrared, to receive a file 
over infrared, to backup the entire data file via a wire to a computer
running the Kermit protocol, to append a backup file to your current 
data file over a wire from a computer running the Kermit protocol, and
to exit NP48, respectively.

When you choose NEW, you will be presented with a screen to choose a 
name of the file.  The name may have spaces, and about anything else 
since it is stored as a string.  After entering the name, TED will 
load with an empty document.  You may now enter text.  When you are 
done, turn off Alpha mode and press Enter.  This will quit TED, save 
the file, and return you to the main menu.

Choosing EDIT will bring up a menu to select which file to edit.  
After selecting a file and pressing ENTER, TED will load with that 
data file.  TED operates exactly the same as explained above.

Choosing DEL will bring up a menu to select which file to delete.  
After selecting a file and pressing ENTER, the file will be deleted.  
Note that there is no confirmation when deleting!

Choosing REN will bring up a menu to select which file to rename.  
After selecting a file and pressing ENTER, a screen like what is shown
when creating a new file is displayed.  It allows you to change the 
old name to whatever you want.  Press ENTER when you are done to save 
the new name.

On the second menu, choosing IR TX will allow you to choose a file to 
send, and then it will send it via infrared to another HP48 running 
NP48.  The file will be appended to the other HP's data file.

Choosing IR RX will receive a file from another HP48 running NP48, as 
explained above.

Choosing BCKUP will send the entire data file over the wire to a 
computer set to receive a file with the Kermit protocol.  It will be 
saved as DATAFILE.NPX, but you may rename it whatever you want.  This 
can be used for backing up your NP48 text files to your computer.

Choosing REST will receive a file over the wire from a computer using 
the Kermit protocol.  It will append the data to the end of the 
current data file.  This can either be used to receive an NP48 backup 
file (see above) or to transfer a standard text file from your PC to 
NP48.

To transfer text files from your PC to NP48, add the following five 
lines to the top of the text document so they will view properly:

%%HP: T(3);
{
C$ 8
Document
C$ $  

Change the word "Document" to whatever you want the title to be in 
NP48, and change the number 8 to the number of characters in the 
title.

You may want to set the word wrap in the text to 33 characters first, 
so you don't have to do any horizontal scrolling in TED/NP48.

Choosing EXIT on either menu will, well, you know what it does.

======================================================================

REMOVING THE LIBRARY

To remove NP48 (although I don't see why you would want to, except to 
install a new version if I ever upgrade this), enter a tagged object 
with the port number you stored it in and the library number of NP48 
(1212), like this, for example: :0:1212  Press ENTER again to 
duplicate it, then type DETACH and then PURGE.  NP48 should now be 
deleted.

======================================================================

KNOWN BUGS

There is one known bug in Notepad 48, but it's not completely NP48's 
fault.  When running NP48 with HPSauce 2.2 or Java 3.0 (not sure about
older versions, but it works fine with HPSauce 1.0), after quitting 
NP48, the softkeys on the bottom of the screen will not reappear.  To 
make them show up, press any key.

I have found one work-around for this bug.  Just create a variable 
with the contents:
<< NP48 #386A1h SYSEVAL >>

If you run NP48 by calling this variable instead of directly running 
NP48, the screen will be redrawn after you quit and everything should 
be okay.  Please note that I have only tested this SYSEVAL on a 
Revision R calculator.  If you enter the number incorrectly, or if you
have a different ROM revision, you stand a chance at clearing your 
memory.  So double-check the SYSEVAL and back up your memory before 
running it!

======================================================================

VERSION HISTORY

1.2b
Updated documentation to explain how to work around the only known 
bug.

1.2a
Updated documentation to explain how to transfer text files from the 
PC to the HP.  Repackaged source code in ASCII format rather than 
binary for easy editing on a PC.

1.2
Fixed most bugs (the only known one is listed above).  Now stores 
DATA.NPX in Port 0.  First major release.

1.1
Never released to the public.  Added I/O functions, but had a couple 
nasty bugs.

1.0
Initial release.  Only released to the public as a part of the 1.2 
package.  Tested by several friends.

======================================================================

OTHER INFORMATION

I also am including NP48.DIR with this distribution.  It is the 
UserRPL source code, ready to be converted to a library, so you can 
edit it to replace every occurrence of TED to Edit or whatever 
stringwriter you prefer to use.  It isn't commented, but all you need 
to do is look for the text TED in the variables EDIT.NPX and NEW.NPX 
(if I remember right).  It is included in ASCII format, so you can 
easily edit it on your PC.

Also included is NP48 1.0, aka NP48 Light, in both library and 
directory formats, which doesn't include I/O functionality or support 
for the CANCEL key to quit.  I included it because it is 1.65k smaller
(3.15k instead of 4.80k) for people who are low on memory.  Its file 
names are NP48LGT.DIR and NP48LGT.LIB.

======================================================================

'PRICING' INFORMATION

This program is "emailware".  If you like it, simply email me to tell 
me.  This will encourage me to continue to write more software, and 
maybe to convert this to SysRPL, if I ever learn it.

======================================================================

DISCLAIMER / LEGAL STUFF

THIS PROGRAM IS PROVIDED "AS IS" AND IS SUBJECT TO CHANGE WITHOUT 
NOTICE.  NO WARRANTY OF ANY KIND IS MADE WITH REGARD TO THE SOFTWARE 
OR DOCUMENTATION.  THE AUTHOR SHALL NOT BE LIABLE FOR ANY INCIDENTAL 
ERROR OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE SOFTWARE AND/OR 
THE DOCUMENTATION.  PERMISSION TO FREELY DISTRIBUTE THIS SOFTWARE IS 
GRANTED PROVIDED THIS MANUAL IS DISTRIBUTED WITH IT WITHOUT ANY 
MODIFICATION.  THIS PROGRAM CAN'T BE USED FOR ANY COMMERCIAL PURPOSE 
WITHOUT WRITTEN PERMISSION FROM THE AUTHOR.  THIS IMPLIES THE USER 
SHOULD NOT BE CHARGED FOR THE USE OF THIS PROGRAM IN ANY WAY, OTHER 
THAN A SMALL DISTRIBUTION FEE, IF APPLICABLE.

This program has been tested on an HP48GX revision M, P, and R and 
hasn't caused any problems.  However, as with any other program, you 
are strongly encouraged to BACK UP YOUR MEMORY before installing 
this, just in case you have a problem.  This program will not run on 
an HP48SX due to its use of the CHOOSE command.

======================================================================

Eric Rechlin
February 10th, 1998
http://hp48.ml.org
http://rechlin.ml.org
rechlin@btigate.com
rechlin@sendit.nodak.edu