Sie sind auf Seite 1von 9

XCELL48 v2.

0
Spreadsheet Library
by
Daniel Lopez Sancho
25-June-1998

DISCLAIMERS
The library 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.
XCELL48 v2.0 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 XCELL48 v2.0 in any way.
Please excuse all the linguistic errors in this text. English is not
my native language (Spanish).

INSTALLING THE LIBRARY


First of all you must install FNT1 (from the Universal Font Library) in your
calculator. If you use FNT3 you don't need to install FNT1.
A copy of the last version of UFL can be found at http://www.engr.uvic.ca/~ascho
orl/ufl/

1. Upload to your 48 the file XCELL48v20.lib with Kermit, Usend, XYModem or


any other transfer protocol. Remember to use binary transfer.
2. Recall the contents of XCELL48v20.lib to the stack ('XCELL48v20.lib' [RCL]).
3. Purge XCELL48v20.lib to save memory.
4. Press 0 (or any other port number you can access) and [STO].
5. Turn off and on your machine (or restart it by pressing [ON]+[C]).

Now your LIBRARY menu will contain the label: [XCELL]

COMANDS
- [XCELL] starts the sheet
- [ABOUTXCELL48] displays some info about the library and the author
WORKING WITH XCELL48
The sheet has a graphical interface similar to any
other spreadsheet program. It has 3 parts:
- The InputLine, where you can enter and edit data,
you can be asked for actions and some cell info is showed
- The row and column delimiters
- The cells
Once you're inside the sheet you can move around with the cursor keys
and extract, copy, import, paste, delete and examine data with the
following keys:

Not shifted
- [A] Shows 'about' message
- [B] Extracts data to stack from cell THROUGH cell. If a cell contains a formul
ae,
the formulae itself is extracted.
The extracted data can be:
- a real, complex or character string delimited by {{}}
- a symbolic row or column delimited by {{}}
- a symbolic matrix delimited by {{}}
- [C] Relative copy of cell from actual cell THROUGH cell
- [D] Makes total SUM (relative) of data contained in SigmaDat (not the standard
SigmaDAT but XCELL48's SigmaDat) and puts the result in the current cell
- [E] Makes the MEAN (relative) of SigmaDat
- [F] Makes the STDEV (relative) of SigmaDat
- [CST] Shows STATUS PAGE with info on flags and properties of the sheet
- [NXT] Shows a two page HELP
- ['] Enter formula (Ex. 'A1*B1+C2')
- [STO] Saves the sheet without leaving using the current name
- [ENTER] Copies current cell to stack (formulaes and/or values)
- [+/-] Changes cursor's movement after entering data from left->right
to up->down. A small arrow in the upper left side of the screen shows th
e
current direction
- [DEL] Deletes from cell THROUGH cell
- [<-] Imports data from stack (level 1) to current cell. Data can be:
- a real, complex, character string or formulae
- a real, complex or symbolic row or column delimited by {{}}
- a real, complex or symbolic matrix delimited by {{}}
- a character string containing data ordered by tabulators
This is useful for importing data from another spreadsheet program
that supports data ordered by tabulators (like EXCEL)
- [.] ... [9] Enter number to current cell (it can have more than one figure)
- [ALPHA] Enter character string to current cell. String will be parsed to
a real, complex or formula if it's possible, so this is a 'general'
way of entering data
- [/] Changes between 'show formulas' and 'don't show formulas' mode. When in
'show formulas' mode the Inputline shows the formula (if any) of the
value in the current cell. When in 'don't show formulas' mode the Inputlin
e
shows the value itself. This is useful when formulas are very long, becaus
e
they must be converted to strings and this slows scrolling a lot. It can b
e
useful too for viewing values longer than the cell dimensions
- [*] Toggles the position mark
- [-] Inserts row at cursor position
- [+] Inserts column at cursor position
- [ON] Exits the sheet (you are asked to save or not the sheet)
- CURSORS

Left Shifted
- [MTH] Saves data (character string) to 'name_of_the_sheet.txt'.
Data will be ordered by tabulators and formulas will be changed from
'A1+5' to =A1+5. This way you can open the file from EXCEL and use
the sheet with its formulas. Before opening it from EXCEL remember to
transfer it in ASCII mode and to delete the string delimiters ("")
once in the PC (with EDIT, NOTEPAD or another ASCII editor).
If you want to print the sheet you can print it from EXCEL or directly
print the file from HP48 as any other file (be sure to have cells smalle
r
than 7 chars to maintain table aspect)
- [EVAL] toggles UNDO ON/OFF
- [TAN] Purges SigmaDat
- [+/-] Edits current cell
- [/] Enter complex to current cell
- [-] Deletes row at cursor position
- [+] Deletes column at cursor position
- [8] Change between BARS and POINTS plot mode
- [0] Sets STD mode
- [2] Sets FIX2 mode
- [3] Sets FIX3 mode

Right Shifted
- [EVAL] makes UNDO/REDO of the last operation made
- [TAN] Adds current cell to SigmaDat.
This way you can select a number of cells and then SUM, MEAN or SDEV
them with [D], [E] or [F]. If you keep the key pressed it will add
next cells continuously in the direction of the arrow in the upper left
side of the screen.
- [8] PLOTS X (BARS mode) or X, Y (POINTS mode). Data is selected with the
EXTRACT function ([B]) and you must extract first X and then extract Y.
Once in the PLOT menu you have the standard keys of the graphic menu.
When plotting POINTS, you can adjust them to a line by pressing [FCN] or
[STATL] (if S or G calculator), and then you can [FCN] and ROOT, ISECT,
SLOPE, AREA, EXTR, EXIT, F(X), F' and NXEQ. If you press NXEQ you will
see the equation of the adjusted line, so this is a good way to make a
linear regression
- [*] Jump to position mark
- [ON] Turns off the machine without leaving
- [-] decreases the number of columns displayed (but increases width of cells)
- [+] increases the number of columns displayed (but decreases width of cells)
You can see a maximun of 10 columns and a minimum of 1. Maximum number of
columns displayed is limited by the existing number of columns but minimum
number of columns is not limited in any way

FINAL REMARKS AND USEFUL NOTES


- When you exit, you are asked for a name. The data will be stored in the
current directory in the named var. If you want to open the
sheet you just have to press the menu key corresponding to that sheet.
This way you can store multiple sheets in different directories and have
a quick access to any of them
- When you make a relative copy and you want to refer the same cell in
each new formula, you can do it by writing $ before the cell name.
For example:
A1=1 B1='$A1+2*A1'
A2=2
A3=3
COPY B1 THROUGH B3
A1=1 B1='$A1+2*A1'
A2=2 B2='$A1+2*A2'
A3=3 B3='$A1+2*A3'
- You can extract a part of the sheet as a matrix of lists and
leave it in the stack. This way is easy to operate it with
many programs like ALG, Math, QPI or visualize it with Java.
If you press [B] you'll get the matrix of formulas.
- Now XCELL48 is compatible with any program that accepts
text data ordered by tabulators like MS EXCEL, LOTUS 1-2-3
or Minitab. You can export data from PC to HP and vice versa.
To export data press [LS][MTH] and transfer the file .txt
created with the name of the sheet to the PC in ASCII mode.
Edit the PC file and delete the string delimiters ("").
Open this file from the program to be used (it has been tested
only on MS EXCEL (but LOTUS 1-2-3 can open text files and
MS EXCEL files).
To import data, save the sheet on the PC as Text with
tabulators and EDIT it to add string delimiters (""). Transfer
it to the HP in ASCII mode. Put it in the stack and open a new
sheet ([XCELL]) or an existing sheet where you want to insert
data. Now, import data with [<-].
It's important to note that EXCEL will only save formulas when
they are shown in the cells. To do this you must choose TOOLS
from the tool bar, choose OPTIONS, select the VIEW window and
check FORMULAS. Now the formulas are shown and you can save them
to a text with tabulators file and export the sheet to the HP48.
XCELL48 always saves formulas in text. This way you can fully
work on EXCEL with an XCELL48 sheet and vice-versa as long the
commands and functions are compatible. If you want to use a sheet
with formulas from one program in another program, you would only
be able to use the formula with compatible functions. For example,
you won't have any problem to use formulas with *, /, + and - (as
well as other functions as SIN, COS,...) because they exist in both
programs. But if you try to use STDV(A1:A10) from EXCEL in XCELL48
you won't be able, just because this function doesn't exist in the
HP48.
I think LOTUS 1-2-3 uses a different format to indicate a formula, so
you won't be able to use sheets from XCELL48 in LOTUS or vice-versa
except if the sheets contain only numbers and text.
- You can now put User Defined Functions (UDF) into formulas. The UDF are
very powerful and are unlimited, as each user can create the UDF he needs
for every sheet. You can create an UDF by typing at the command line
outside XCELL48 (for example):
'STDV(A,B)=Symbol of square root(((A^2+B^2)/2-((A+B)/2)^2)*2)'
This is the formula of the Standard Deviation for 2 values. If you now type
DEFINE, you'll create an UDF. If you put it now in a formula (from inside
XCELL48), for example 'STDV(A1,A2)' you'll get the same result as if you use
the internal STDV with A1 and A2.
Another interesting example: You take the value (real) of a cell and want to
round it to the upper integer if its fractional part is bigger than 0.49 and
to the lower integer if it is less than 0.5. This can be easily done with the
function RND, but if you want to add 100 to the number if it has been rounded
to the upper value and 10 if it's been rounded to the lower you can't do this
with RND. One way to do this is using the IFTE (IF Then Else) function and
creating an User Defined Function (UDF). This function (IFTE) has a condition
and two algebraics. Depending on the result of the conditional part it
evaluates one algebraic or the other. It would be like this:
condition algebraic1 algebraic2
'RND2(X)=IFTE(FP(X)>0.49,CEIL(X)+100,FLOOR(X)+10)' DEFINE
Now imagine the cell you want to operate on is A1, then: 'RND2(A1)'
and that's all! Easy enough? You may ask: why don't we put all the IFTE inside
a formula directly changing the X for the cell name without creating an UDF?
The fact is that the IFTE funtion nests 2 algebraics inside another one and
XCELL48 can't work with algebraics nested two or more levels depth.
You can create as many UDF as you need and for any purpose you want. Consult
the User Manual of the HP48 for more info on UDF and IFTE.
- You can use a program from inside a formula as long the program doesn't
take any argument and returns only one value. For example, if you've got a
program like this << 33 SF >> (that sets the user flag 33) and store it
in the variable 'AB' you can eval it by 'A1-A1+AB'. In this case as you don't
want the program to do anything, you must put a 0 inside the program
<< 33 SF 0 >> in order to have the formula correctly evaluated ('A1-A1+0' =0)
You can use a program taking one argument as long as the program returns two
values. For example you can use a program that took a number and depending on
the number returned one thing or another:
<< IF 1 == THEN 1 ELSE 100 END 0 >> this program is named 'AB'. If you enter a
formula like this 'A1+AB', when A1=1 then the formula will be 1, but if A1<>1
then the formula will be 100. This happens because the formula is evaluated in
RPN notation, first A1, then AB and at last +. When the AB program is evaluate
d,
A1 is already in the stack.
As you can see this is very flexible and allows you to do almost everything
you want, but the library doesn't check if the program accomplishes the two
conditions, so use this feature carefully!!
- The UNDO/REDO feature takes up a lot of memory and time if the sheet is big.
So if you are running out of memory or the sheet is so big that the undo
slows it a lot, the best thing you can do is to disable it by pressing
[LS][EVAL]. Once disabled, it will remain like that until you enable it, no
matter if you exit the sheet (as long as you save it).
- You can use any function in the formulas like IP (integer part), FP (fractiona
l
part), CEIL and many, many more. The only function you can't use is the IFTE
function if it contains algebraics, because the formulas are parsed in only 1
level depth and the IFTE function nests algebraics in two level depth. You can
use it in this case for example:
A1=1 B1='IFTE(A1==1,1,100)'
here the result will be 1 except if A1<>1. If you need to use the IFTE functio
n
putting algebraics inside of it you can make it through a User Defined Functio
n
- There's no RAD/DEG or RECT/POLAR change from inside the program. They're
selected at the start of the sheet (it takes the values you've actually
selected) and you cannot change them afterwards except you do it with an
external program as explained above.
- XCELL48 can handle very large sheets (I've tested up to 50x50) with no or
little lost of performance except if it has to recalculate big amounts of
data.
- The library has been developed on a HP48SX with the RPL48 v1.12b
DEVELOPMENT PACKAGE, the DEBUGGER 1.0b and ED.
It is completely written in Sys-RPL and Machine Language.
It makes use of many "unsupported" entries. Use it at your own
risk. It has been working fine on a HP48SX revision J and on
a HP48GX revision R and nothing wrong has happened. However, remember
to backup your memory before using it.
- Library is ID 1220. Its size is 12188 bytes and its checksum is #F3DCh.

CHANGES FROM version 1.0


- Eight rows display
- Now there's only one way to enter data. You can enter whatever
(just like in the command line) and when you press [ENTER] it
will be parsed to one of the 4 types of objects the program
handles (real, complex, formulas and character strings)
- It doesn't support programs in cells anymore. It wasn't very
useful and made trouble with some of the new features
- There's a variable number of columns from one to six. You can
change it with [RS][-] and [RS][+]
- You can extract a part of the sheet as a matrix of list and
leave it in the stack (useful if you want to use XCELL as a
symbolic matrix writer).
- Now you can import data from the stack (like the matrix of
list above) and insert it in any cell with [<-]
- Now XCELL48 is compatible with any program that accepts
text data ordered by tabulators like MS EXCEL, LOTUS 1-2-3
or Minitab.
- Now you can print data or use EXCEL to print it
- New COPY and EXTRACT routines
- Now when a cell is empty it will be treated as if it was 0
- Some bugs have been fixed:
- If you entered A1='A2+1' and A2='A1+1' then you used to get
an infinite loop. Now it's fixed
- If you deleted a row or column with its first element being
used in another cell, it crashed up. Now it's fixed
- It is compatible with sheets of previous versions, but make sure
they don't have programs inside!
- It takes 700 bytes less than the previous version!!

CHANGES FROM version 1.3


- A small bug has been fixed
- Faster scrollings

CHANGES FROM version 1.5


- New UNDO/REDO of the last operation made
- Now there is the possibility to put User Defined Funtions into formulas
- Now you can eval a program from inside a formula as long the program
doesn't take any argument and returns only one value.
- It can be used from any port
- New graphic interface %100 ML (thanks Nate...). It's incredibly fast!
- New cursor movement direction marker
- More than the %90 of the routines of the library have been rewritten.
There are more than 2 kb's of ML routines for speed
- You can choose to display from 1 to 10 columns
- New routines for EXTRACT and IMPORT (the way to copy and paste). Now
can deal with cells, rows or columns and blocks, and are much faster.
Import is now much safer thanks to a new type_of_object test
- New routines for COPY that speeds it up many times
- New routines for TOTAL, MEAN and STANDARD DEVIATION much shorter and
faster (new algorithms, thanks Dominique...)
- New autoevaluation routines %100 ML. The autoevaluation is boosted
more than a %1500 depending on the sheet. As an example, an
autoevaluation that took 28 sec in v1.5 now is done in 2 sec.
- Now the sheets are limited up to 26 columns (A...Z, to avoid any type
of problem with the column names) but the number of rows is limited only
by available memory.
- There is also a new small feature: each time the data list is updated
the busy annunciator winks. This way you know that anything is happening
while autoevaluations, row or column adding/deleting, copying cells or
importing data.
- The lower case can be fixed in the editor
- A pair of non-agressive bugs have been fixed
- The library is %100 backwards compatible from version 1.0 to version 2.0
as long as the sheet doesn't contains any program (only 1.0 sheets)
- Now you can purge the first row/column of the sheet.
- When you lose a reference (for example if you have A2=A1+1 and you
purge column 1 then A1=@1+1) the strange name (@1) is changed for an error
delimiter (#!) and an error is generated as output for the formula.
- The library is 500 bytes shorter!!

ACKNOWLEDGEMENTS
I would like to thank the following persons
- Nathanael J. Morriss for the %100 assembly display routines and many, many
talks. It's because of you that this new version exists. Thanks for forcing
me to learn ML.
- Detlef Mueller and Raymond Hellstern for RPL48
- Mika Heiskanen for DEBUGGER and ED
- Manuel Jaumar for letting me his HP48GX (R) for alpha days (when alpha tends
to infinite...)
- Al Arduengo for his kindness, courage, enthusiasm and exAL that
started everything
- Reuben F. Burch for beta testing and MS EXCEL help
- Dominique RODRIGUEZ for beta testing and suggestions (new STDEV formula)
- Othniel Rawlins for beta testing and suggestions
- Maj Chris McCormack for his help with this documentation (grammar/spelling)
- Duncan Cochran for his millions of suggestions (many of them implemented in
this new version) and betatesting
- David Hanon for betatesting and suggestions
- Luiz Sergio Sieber Padilla for betatesting
- Virgilio Rueda Cadena for betatesting
- HP for HP48 and TOOLS

As I explained in the DISCLAIMERS part, this software is freeware,


but many hours (and days...) of programming and debugging have been
invested in developing this library. So, the author will be much more
than satisfied if someone tells him that he appreciates the library
and he uses it a lot. The author will also be glad to solve (or at least,
try to...) all the problems that you can have using XCELL48.
You can contact me by:
POST: Daniel Lopez Sancho
c/ Gran Via Carles III, 67 4 2
08028 BARCELONA
SPAIN
PHONE: + 34 93 330 78 42
FAX: + 34 93 377 15 14
E-mail: corma@sefes.es

I will try to answer all questions I receive.

Das könnte Ihnen auch gefallen