[Top] | [Contents] | [Index] | [ ? ] |
Oleo is the GNU spreadsheet program. This documentation is of Oleo version 1.99.13, as of July 29 2000. It is by no means complete, nor necessarily accurate for that matter.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo
is the GNU spreadsheet (1).
Oleo
has more than one user interface.
The traditional oleo
environment shows a curses based (character mode)
user interface.
A bare bones user interface based on the X Window System exists as of
version 1.6 which dates back to 1994.
In 1998, development started for a motif
based user interface.
It should be more user friendly than the character based UI.
Most of this manual describes the character based user interface,
the motif
user interface is treaded in (see section 14. A Motif Graphical User Interface for Oleo).
To start Oleo, type oleo
. If filename
is the name of a
spreadsheet that you have saved from a previous oleo
session, you
can type oleo filename
to start Oleo with the spreadsheet
loaded.
To stop Oleo, type C-x C-c
. This will prompt you for the name of
a file in which to save the current spreadsheet. If you do not want to save
it, type RET, otherwise type the name of the filename that you
wish to save it in, and then press RET.
Type C-z to suspend oleo
. This does not do anything if
you are running under X-windows.
If you wish to abort a command, type C-g
Typing How to type commands Cell referencing Two ways of naming cells The Screen The parts of the screen Cursor and Mark The cell cursor and the mark Recalculation How updating works Movement Moving around the spreadsheet Mouse Using the mouse Regions and Variables How to use regions and variables Getting Help Getting help Saving and reading Saving and reading Spreadsheets Command Line Options Command Line Options .oleorc file The initialization file Expressions Types of expressions
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
We use emacs abbreviations for keystrokes. These examples should make the notation clear.
Some commands are not bound to key strokes. For instance, if you wish
to erase the entire spreadsheet, you have to use the command
clear-spreadsheet
. To execute a command, type M-x and then
the command name:
M-x clear-spreadsheet |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Many commands and functions operate on a given cell or group of cells, and therefore take a cell or range reference (address) as an argument. An individual cell is specified by its row/column coordinates, which start with row 1, column 1 in the upper left of the spreadsheet. A range is a rectangular group of cells, specified by giving its left and rightmost columns and top and bottom rows.
A reference may be absolute or relative. An absolute reference is measured from the upper left of the spreadsheet, and does not change when the cell containing it is moved or copied. A relative reference, however, is measured as an offset from the cell it is in, and when moved points to the cell at the same offset relative to the new location.
There are two ways of addressing cells in Oleo, called a0
and
noa0
. To switch between the modes, use the set-option
command:
M-x set-option a0
a0
mode.
M-x set-option no a0
noa0
mode.
In both modes the case of cell and range letters is ignored.
noa0 mode Using noa0 Mode a0 mode Using a0 Mode Comparison Comparing a0 and noa0 modes
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In noa0
mode (the default), absolute cell addresses have the
form RrowCcol
, where row and col are
the row and column (as integers). Thus, R1C2
is the second cell
from the left on the top row. The cell in the leftmost uppermost corner
is R1C1
, and the cell in the rightmost lowermost corner is
R65535C65535
.
Relative addresses have the form
R[rowoffset]C[coloffset]
, as in R[-1]C[+1]
(the cell above and to the right of the current cell). An offset of 0
can be omitted, along with its square brackets: RC[+2]
(the cell
two columns to the right). The plus signs of positive offsets can also
be omitted. Absolute and relative addresses can be combined, as in
R4C[-1]
(the cell in row four that's one left of the current
cell).
Ranges in noa0
mode are specified as
Rrow1:row2Ccol1:col2
, where the row
and column references may be either absolute or relative, and can be
mixed. Thus, R1:4C1:[-2]
refers to the cells of rows one through
4, columns one through the second column to the left. If row1 =
row2 or col1 = col2, the colon and second number may
be omitted, as in R1:10C2
(rows one through ten in column two).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In a0
mode, relative references have the form col_let
row_num, where col_let is the letter of the column and
row-num is the row number. col_let can be upper or lower
case. The cell in the leftmost uppermost corner
is A1
, and the cell in the rightmost lowermost corner is
CRXO65535
. The columns are initially single letters (A-Z) , then
double letters (AA-ZZ), then triple letters (AAA-ZZZ), and finally some
quadruple letters (AAAA-CRXO).
B3
refers to the cell in the second column of row 3.
Since this is a relative reference, it will change when the containing
cell is moved, to refer to the cell at the same relative position;
e.g., if the cell is moved two columns to the right the reference will
change to D3
.
Absolute references have the form
$
col_let$
row_num, as in $A$1
(top left
cell). These do not change when the containing cell is moved. Both
types can be mixed with predictable results, e.g., $A4
has an
absolute column but a relative row.
Ranges are given as cell_ref:
cell_ref or
cell_ref.
cell_ref, where the cell_refs describe
diagonally opposite corners of the range. Thus, A1:B2
refers to
the topmost, leftmost four cells in the spreadsheet.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In order to get an understanding of these two addressing modes, assume that the
cell cursor is in E7
= R7C5
. The left hand column is noao
mode, and the right hand one is a0
mode.
R1C2 $B$1 R[-1]C[+1] F6 RC[+2] G7 R4C[-1] $D4 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Minibuffer The input line Status Line The status line Work Area The work area and its borders
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The input line is also referred to as the Minibuffer. This is where you enter data into cells (see section 2.2 Entering values in a cell). You can change the location of the input line. For example, to change the input line to the bottom of the screen, type
M-x set-option RET input -1 |
This can be made the default. (see section 1.12 The `.oleorc' file)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The status line describes the current status. This includes:
A1
or R1C1
), or the current
range (cursor to mark) if the mark is set
(2)
For instance, if the mark is located at cell D4
, the cell cursor
is in cell A11
, the cell contents is @sum(A1.B10)
, and the
sum of the entries in the region A1.B10
is 89, then the status
line is
*A11:D4 89 [@sum(A1.B10)] |
The `*' indicates that the mark is set, and thus A11:D4
is
the range from the cursor cell to the mark. You can change the location
of the status line using M-x set-option
. To move the status line
to the bottom of the screen, type
M-x set-option RET status -1 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The work area is surrounded by a border giving the row and column numbers. When there are multiple windows, there will be several borders. A cell is a box that can hold data. The cell cursor is the highlighted rectangle indicating the `active cell'. A region is a rectangular block of cells. Regions are described by giving coordinates of the upper left cell and lower right cell.
The appearance of the screen can be changed (see section 6.1 Changing Oleo's appearance).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
goto-cell
)
goto-region
)
mark-cell
)
exchange-point-and-mark
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo periodically recalculates the values of the spreadsheet
that can change. This calculation can be done between keystrokes, and
usually stops when a key is pressed. This behavior can be changed with
the options background
and nobackground
. The time between
updates (initially 10 seconds) can be changed using the option
ticks
. You can also disable automatic recalculation with the
option noauto
. In this case, recalculation is only done when the
recalculate
command is used.
(see section 6. Options)
recalculate
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Single Cell Movement Moving to a neighboring cell Scanning Finding the next empty cell Large Scale Movement Moving long distances Movement examples Examples of movement commands Screen Moving Moving by screens
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
up-cell
)
down-cell
)
right-cell
)
left-cell
)
There are also commands for diagonal movements, but they are not bound
to any keys. These commands are
upleft-cell
, downleft-cell
,
upright-cell
, downright-cell
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
scan-up
)
scan-down
)
scan-right
)
scan-left
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These commands move over large areas of the spreadsheet, so they first
set the mark to the current cell before moving (if it's not already
set). You can thus jump back to where you were with C-x C-x
(exchange-point-and-mark
).
upper-left
)
lower-right
)
beginning-of-row
)
end-of-row
)
beginning-of-column
)
end-of-column
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The first column is the command, the second is the cell the cell cursor is in initially, and the third column is the location of the cell cursor at the end of the command.
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These commands scroll the current window one screenful in the appropriate
direction. They try to leave the cell cursor in approximately the same
place, so that M-v followed by C-v should leave the cell
cursor in the original cell. In addition to these commands, there are
diagonal movements that are not bound to keys:
scroll-upright
,
scroll-upleft
,
scroll-downright
,
scroll-downleft
.
scroll-up
)
scroll-down
)
scroll-right
)
scroll-left
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is possible to use to mouse to move the cell cursor. down-mouse-0 means to press the leftmost mouse button.
mouse-goto
)
mouse-mark
)
mouse-mark-and-goto
)
(6)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Variables are symbolic names for regions of a spreadsheet. Once
defined, they can be used in cell formulas as region addresses. They
can also be used as arguments to any command that expects a region
address. A variable name should not be the name of a cell. Thus,
A1
is not a good name for a variable.
set-variable
). For
instance, to set the variable test1
to the region B2:C3
,
type
C-x : test1 RET B2:C3 RET |
test1
, type
C-h v test1 RET |
test1
as tset1
, you get the message
there is no 'tset1' |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
describe-key-briefly
)
describe-key
)
describe-function
)
@sum
is used in
a0
mode, you must type C-h F sum, not C-h F @sum.
(describe-formula-function
)
where-is
)
show-variable
)
show-all-variables
)
show-options
)
view-wallchart
)
write-wallchart
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo
can save a spreadsheet, visit a saved one, or merge with a
previously saved one.
save-spreadsheet
)
(7)
visit-spreadsheet
)
merge-spreadsheet
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
At the command line, Oleo has several options
oleo [options] [file] |
where file
is an optional spreadsheet to open. The remaining
options are
-q
--quiet
-V
--version
-h
--help
-f
--ignore-init-file
--nw
-F x
--format x
--filter
-s x
--separator x
-S
--space
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If there is a file `.oleorc' located in the home directory, it is
read when Oleo starts up. For example, if you always want to use the
a0
reference system, and wish to have the status line on the bottom
line, rather than on the second line from the top, your `.oleorc'
file could be (10)
set-option a0 set-option status -1 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A cell entry is a value or an expression of values (see section 2.1 The different values in Oleo).
Infix expressions Infix Expressions Examples Examples of infix expressions Error values A List of Error Values
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following infix expressions are defined. Values labeled N1 and N2 are numbers (floats or integers), bool booleans, str strings, and val any type (but both sides must be the same type).
-N1
!bool
#TRUE
if bool is #FALSE
,
#FALSE
if #TRUE
, and an error otherwise.
N1 ^ N2
N1 * N2
N1 / N2
N1 + N2
N1 - N2
N1 % N2
N1 >=N2
#TRUE
if N1 is greater than or equal to N2; else #FALSE
N1 > N2
#TRUE
if N1 is greater than N2; else #FALSE
N1 < N2
#TRUE
if N1 is less than N2; else #FALSE
N1 <=N2
#TRUE
if N1 is less than or equal to N2; else #FALSE
val1 = val2
#TRUE
if val1 and val2 can be
considered equal, #FALSE
if not. val1 and val2 can
be numbers, strings, or boolean values.
val1 != val2
!(val1 = val2)
.
str1 & str2
bool ? val1 : val2
#TRUE
, val1 is
evaluated; if bool is #FALSE
, val2 is evaluated;
otherwise an error is returned.
(expr)
1.13.2 Examples 1.13.3 Error Values
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Assume that the spreadsheet contains the figure below, where the block of X's marks the cursor.
|
Here are some computations in a0
mode.
C2 * D4 => 21 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Error values are returned by the parser under various error conditions, such as invalid parameters to functions, badly formatted expressions, etc.
#TRUE
#FALSE
#ERROR
#BAD_INPUT
#NON_NUMBER
#NON_STRING
#NON_BOOL
#NON_RANGE
#OUT_OF_RANGE
#NO_VALUES
#DIV_BY_ZERO
#BAD_NAME
#NOT_AVAIL
#PARSE_ERROR
#NEED_OPEN
#NEED_CLOSE
#NEED_QUOTE
#UNK_CHAR
#UNK_FUNC
#INF
#INFINITY
#NINF
#MINUS_INFINITY
#NAN
#NOT_A_NUMBER
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1 The different values in Oleo Entering Entering values in a cell Input Editing Editing in the input line Cell Motion Moving to the next input cell while editing
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A value can be a literal (an immediate value, like "foo"
,
16
, or #TRUE
), a function call, or another expression.
There are 5 types of values:
-
]nnn[.
nnn][e
[-
]nnn],
e.g., -103.14e-7 or .00000012 or 103.14.
"This is \"quoted\"."
) or use an octal escape code:
`\nnn'
where nnn is the octal code for the ASCII value of the character.
@sum(A1.B3)
, or A1 + B2
.
#TRUE
or
#FALSE
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
set-cell
)
set-cell-region
)
For example, to put the numbers 2,3,...,11 in the cells from B1
to
B10
, type
M-= B1.B10 RET @row()+1 RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When the spreadsheet is reading text input, you can use a few text-editing commands. Note that there in no history mechanism and no yank command. If you accidentally type C-u, the text is erased. (11)
While the input area is active, the commands that move the cell cursor are disabled. If you want to move the cell cursor, use the other-window command (C-x o) to leave and later reenter the input area.
insert-abs-ref
)
insert-rel-ref
)
insert-cell-expression
)
insert-cell-value
)
cursor-begin-line
)
cursor-end-line
)
cursor-back-char
)
cursor-back-word
)
cursor-fwd-char
)
cursor-fwd-word
)
delete-next-char
)
delete-next-word
)
delete-prev-char
)
delete-prev-word
)
delete-to-end
)
The following commands are not bound to any keys
toggle-overwrite
delete-to-start
Almost all editing commands remember what you typed the last time you used that command, and start you up editing a copy of that text. If you want to type in something completely new, just type C-x (or C-u) and type in your new text.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When you are finished entering data in a cell, you type RET. If
you wish to enter data in the cell below, type either C-i or the
down-arrow key, and you are
placed in the cell below, waiting for input. If you type the up-arrow
key, you are placed in the cell above, waiting for input.
If you type C-j, you
move to the right. The direction of C-i can be changed - the
commands are given below. For example, if you wish to move upwards when you
type C-i, type C-x m ^
.
next-edit
)
next-edit-set
)
auto-move-up
auto-move-down
auto-move-left
auto-move-right
auto-move-up-left
auto-move-up-right
auto-move-down-left
auto-move-down-right
auto-move-no-motion
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Copying Copying cells and regions Moving Moving Cells and regions Deleting Deleting cells and regions Insertion Inserting a new row or column
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a0
mode, this means
that the relative addresses in the new locations' formula(s) will change
to reflect the new cells they refer to.
copy-region
)
copy-values-in-region
)
Consider the spreadsheet, where B2
contains @sum(C2.D2)
:
|
If you type M-c B2 RET B3.B4
, then B2
is
unchanged, but B3
contains @sum(C3.D3)
, since it was
copied from a formula with relative addresses. Similarly, B4
contains @sum(C4.D4)
. The display shows
|
If you had typed M-C-c B2 RET B3.B4
, then B2
is unchanged, B3
contains 8, B4
contains 8, and the
display shows
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
copy-region
. (12)
(move-region
)
Consider the previous spreadsheet, where B2
contains
@sum(C2.D2)
.
|
If we type M-m B2 RET B3
, then B2
is empty,
B3
contains @sum(C3.D3)
, and the display shows
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
delete-row
) For instance, to delete the row
containing the cell cursor, and the next 4 rows, type C-u 5 C-k
.
delete-col
) For instance, to delete the column that
the cell cursor is in, and the 3 columns to the right, type C-u 4 M-k
.
delete-region
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These commands insert blank rows and columns.
insert-row
) For instance, to add 5 rows above
the cell cursor, type C-u 5 C-o
.
insert-column
) For instance,
to add 4 rows to the left of the cell cursor, type C-u 4 M-o
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is often important to change how the value of a cell is displayed. It is possible to change the height and width of a cell, the font used in a cell, the alignment and protection of a cell, and the formats used to represent numbers. Entire rows and columns can be hidden.
Alignment Aligning cell entries Formats for numbers Formats for numbers Cell Height Changing the height of cells Width of Cells Changing the width of cells Hidden Rows and Columns Creating hidden rows and columns Protection Protecting cells Fonts (in X11) Working with X11 Fonts
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
set-cell-alignment
).
set-region-alignment
).
set-default-alignment
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
set-cell-format
).
set-region-format
).
set-default-format
).
There are some examples following a description of the simple and general formats.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
integer
float
hidden
graph
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following formats require a precision. The precision may be a number from zero to 14, in which case that number of digits will always be displayed after the decimal point (zero-padding or rounding the number as needed), or the precision may be 'float', in which case Oleo will use as many digits as necessary.
general
dollar
comma
percent
fixed
exponent
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Suppose that a cell contains `1234.567'. If we set the format of the cell to the left hand column, the cell is displayed as in the right hand column:
integer 1234 hidden general.float 1234.567 general.1 1234.6 dollar.0 $1,234 dollar.2 $1,234.57 comma.1 1,234.6 percent.0 123457% fixed.1 1234.6 exponent.2 123e+03 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can define up to sixteen user-defined numeric formats. The current parts of a format are in the table below. We use the definition of the 'dollar' format for an example. (14)
Example:
$
(
)
$0
,
.
0-14
float
number
Some advice: do not use digits for the headers, trailers, the comma, or the decimal point symbol. Using digits will confuse the internal routines and produce incomprehensible results. . . (15)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
set-cell-height
).
set-region-height
).
set-default-height
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
set-cell-width
).
set-region-width
).
set-default-width
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a0
mode
M-x set-region-width RET C1 RET 0 RET |
or more simply,
M-r w C1 RET 0 RET |
This hides the third row in noa0
mode
M-r h RET R3C1 RET 0 RET |
If the cell cursor is located at any cell in the third column, then we can hide the third column column:
M-a w 0 RET |
Similarly, if the cell cursor is in the fourth row, we can hide the fourth row:
M-a h 0 RET |
To make a row visible again, just set its height to some positive value.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
E5
is protected,
and you attempt to enter data into it, you are not allowed to. Instead, you
get the message
Cell C5 is locked. |
The default is that all cells are unlocked.
set-cell-protection
).
set-region-protection
).
set-default-protection
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The default cell font is 12 point times-roman. The easiest way to specify a font is to use one of the built-in short-hand names. These names are `fixed', `times', and `courier'. Optionally, these names can be followed by a scale. The scale is the ratio of the default point size to the desired point size. For example, if the default font is a 10 point font, then `times 1.2' refers to a 12 point Times-Roman type font.
M-a o times RET 2.0 RET |
set-cell-font
)
M-r o courier RET 1.0 RET |
set-region-font
)
M-r o fixed RET 1.0 RET |
set-default-font
)
M-x set-default-point-size RET 10 RET |
set-default-point-size
)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo can split a spreadsheet into two or more windows. The windows showing the spreadsheet can show different parts of it. Only one spreadsheet can be displayed at a time.
Windows Introduction to Oleo windows. Split Window New windows are made by splitting existing windows. Other Window Moving to another window or doing something to it. Change Window Deleting windows and changing their sizes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
At any time, one of the windows is the selected window. The cell cursor is located in this window. Each other window has a location of point as well, but since the terminal has only one cell cursor there is no way to show where those locations are.
Commands to move the cell cursor affect the cell cursor for the selected Oleo window only. They do not change the value of the cell cursor in any other Oleo window.
When there are multiple windows, they can have different regions, because they can have different values of the cell cursor.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
split-window-vertically
).
split-window-horizontally
).
The command C-x 2 (split-window-vertically
) breaks the
selected window into two windows, one above the other. Both windows start
out displaying the cell cursor in the same position. By default
the two windows each get half the height of the window that was split.
C-x 5 (split-window-horizontally
) breaks the selected
window into two side-by-side windows.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
other-window
). That is o, not zero.
scroll-other-window
).
To select a different window, use C-x o (other-window
).
That is an o, for `other', not a zero. When there are more than two
windows, this command moves through all the windows in a cyclic order,
generally top to bottom and left to right. After the rightmost and
bottommost window, it goes back to the one at the upper left corner.
When the minibuffer is active, the minibuffer is the last window in the
cycle; you can switch from the minibuffer window to one of the other
windows, and later switch back and finish supplying the minibuffer argument
that is requested.
The usual scrolling commands apply to the selected
window only, but there is one command to scroll the next window.
C-M-v (scroll-other-window
) scrolls the window that
C-x o would select.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
delete-window
). That is a zero.
delete-other-windows
).
To delete a window, type C-x 0 (delete-window
). (That is
a zero.) The space occupied by the deleted window is given to an
adjacent window. Once a window is deleted, its attributes are forgotten.
C-x 1 (delete-other-windows
) is more powerful than
C-x 0; it deletes all the windows except the selected one (and the
minibuffer); the selected window expands to use the whole frame.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo has various options. They can be set as a default in the
`.oleorc' file, or using the command M-x set-option
.
To see all the current options, type C-h o
.
Appearance Changing Oleo's appearance Window Options Options for the active window Other Options Other Options
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
a0
noa0
Default
)
status
Default=2
)
input
Default=1
)
edges
Default
)
noedges
standout
Default
)
nostandout
list (ch)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following options affect the currently active window:
page
nopage
pageh
nopageh
pagev
nopageh
link
nolink
unlink
lockh
nolockh
lockv
nolockv
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
auto
Default
)
noauto
bkgrnd
background
Default
)
nobkgrnd
nobackground
backup
Default
)
nobackup
bkup_copy
nobkup_copy
Default
)
ticks
print
file
load (file-name)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Writing Files Writing ASCII and Postscript Files Graphing Graphing Using GNU Plotutils
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Spreadsheets, and regions of spreadsheets, can be printed in ASCII, LaTeX, or postscript format. For postscript files, the font and page size can be specified.
print-region
)
For example, if the mark is not
set, and you want to print the region A1.C20 to the file
`/tmp/myfile', then you type
M-C-p a A1.C20 RET /tmp/myfile RET |
If the mark had been set so that the region between mark and the current cell is A1.C20, then you only need type
M-C-p a /tmp/myfile RET |
If the mark is set, you are prompted for a file name. The region
between mark and cell cursor will be printed in LaTeX format. If the
mark is not set, then you are first prompted for the region, and then
for the file name. (latex-region
) For example, if the mark is
not set, and you want to print the region A1.C20 to the file
`/tmp/myfile.tex', then you type
M-C-p l A1.C20 RET /tmp/myfile.tex RET |
If the mark had been set so that the region between mark and the current cell is A1.C20, then you only need type
M-C-p l /tmp/myfile.tex RET |
psprint-region
)
For example, if the mark is not
set, and you want to write the region A1.C20 in PostScript to the file
`/tmp/myfile', then you type
M-C-p p p A1.C20 RET /tmp/myfile RET |
If the mark had been set so that the region between mark and the current cell is A1.C20, then you only need type
M-C-p p p /tmp/myfile RET |
set-default-ps-font
) See section 4.7 Fonts (in X11) for
information about the possible fonts.
To set the font to 24 point courier, type
M-C-p p f courier 2.0 RET(22) |
set-page-size
). You are prompted for a pagesize. There are
several possible ways of describing a page size:
8.5x11 -- a page size in inches. 22x28c -- a page size in centimeters. 612x792p -- a page size in points. letter -- 8.5 x 11 in. (the default) |
To set the correct page size for A4 paper, type
M-C-p p s A4 RET |
The following table gives the possible paper sizes. The widths and heights are given in "points", of which there are 72 in an inch.
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Note: this chapter is only partially updated, however functionality has changed drastically !!
Plotting in Oleo is done using GNU Plotutils. (Versions prior to Oleo 1.99.12 used gnuplot.) Currently these types of graphs are supported :
There are two modes in which Oleo can produce plots on the fly :
The former is the default behaviour of you use the Motif interface of Oleo, the latter can be initialised by this sequence :
M-g o t f - RET |
This sequence sets output device to Tektronix, and output file to - which means to standard output. Sending Tektronix formatted output to an xterm will pop up xterm's Tektronix emulation window which shows the plot.
The file examples/xy.oleo can be used to show a simple XY plot in this way.
Oleo can print up to 10 different data sets at once. The data sets are numbered 0,1,...,9.
When the plot command (p) is chosen, all the currently defined data sets will be plotted.
Clearing Plots Clearing the plots Data sets Choosing a data set The axes Changing the axes style Viewing Choices Viewing your choices Output Type Choosing the output type Style Options Picking a plot style Name Options Naming a data set
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The plot ranges and styles are remembered; if you decide to plot using M-g, you probably want to clear the ranges and styles using the C and R keys in the main graph menu:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The key d is used to choose a range for a data set. If the mark is active, then the region between the mark and the current cell is chosen as the data set. Otherwise, you are prompted for the range.
When you define a data set (using the d key in the graph menu), you select a number to refer to the data set. If we are already in the graph menu (having typed M-g), then the following assigns the region G5.L6 to data set 4:
d 4 RET G5.L6 RET |
If the mark is set, then it is not necessary (nor possible) to enter the range. Thus, if the mark is set to G5 and the cursor is in L6, then these commands set the fourth data set to G5.L6:
d 4 RET |
| Col B | Col C | Col D | Col E | Col F | ------|-------|-------|-------|-------|-------| Row 2 | 11 | 33 | 55 | 77 | 99 | ------|-------|-------|-------|-------|-------| Row 3 | 22 | 44 | 66 | 88 | 0 | ------|-------|-------| ------|-------|-------| |
and that we are in the graph menu.
(11,33) -- (22,44) -- (55,77) -- (66,88) |
(11,22) -- (33,44) -- (55,66) -- (77,88) -- (99,0) |
(0,11)--(1,33)--(2,55)--(3,77)--(4,99)--(5,22)--(6,44)--(7,66)--(8,88)--(9,0) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The commands x and y allow you to control the axes style.
x [ -3 RET x ] 5 RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Typing v in the main graph menu gives a help screen with all of your choices. A typical help screen is
Graph type is XY plot. Parameter Value output type Tektronix output file - x-axis title "Tijd" y-axis title "Appelen" logarithmic axes -neither- x-axis range [def..def] y-axis range [def..def] Data Set 0 data for this set: A1:A6 style for this set: lines Data Set 1 data for this set: C4:C9 style for this set: lines |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The o key in the main graph menu selects the type of output. A graph can be drawn in several ways - see the table below.
Note however that, depending on compilation parameters, not all of the options documented below may be available (e.g. no X or x commands).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
n 3 RET "my Fermat plot" RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.1 Keyboard Macros 8.2 Basic Use 8.3 Naming and Saving Keyboard Macros
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A keyboard macro is a command defined by the user to abbreviate a sequence of keys. For example, if you discover that you are about to type C-b forty times, you can speed your work by defining a keyboard macro to do C-b and calling it with a repeat count of forty. (29)
start-kbd-macro
).
end-kbd-macro
).
call-last-kbd-macro
).
store-last-kbd-macro
).
Keyboard macros differ from ordinary Oleo commands in that they are simply records of keystrokes. This makes it easier for the novice to write them, and makes them more convenient as temporary hacks. However, the Oleo command language is not powerful enough as a programming language to be useful for writing anything intelligent or general. For such things, functions and programs must be used.
You define a keyboard macro while executing the commands which are the definition. Put differently, as you define a keyboard macro, the definition is being executed for the first time. This way, you can see what the effects of your commands are, so that you don't have to figure them out in your head. When you are finished, the keyboard macro is defined and also has been, in effect, executed once. You can then do the whole thing over again by invoking the macro.
Basic Kbd Macro Defining and running keyboard macros. Save Kbd Macro Saving keyboard macros
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To start defining a keyboard macro, type the C-x ( command
(start-kbd-macro
). From then on, your keys continue to be
executed, but also become part of the definition of the macro. `Def'
appears in the status line to remind you of what is going on.
(30)
When you are
finished, the C-x ) command (end-kbd-macro
) terminates the
definition (without becoming part of it!). For example
C-x ( M-f foo C-x ) |
defines a macro to move forward a word (while editing the input line) and then insert `foo'.
The macro thus defined can be invoked again with the C-x e command
(call-last-kbd-macro
), which may be given a repeat count as a
numeric argument to execute the macro many times.
If you wish to repeat an operation at regularly spaced places in the spreadsheet, define a macro and include as part of the macro the commands to move to the next place you want to use it.
You can use function keys in a keyboard macro, just like keyboard keys. You can even use mouse events, but be careful about that: when the macro replays the mouse event, it uses the original mouse position of that event, the position that the mouse had while you were defining the macro. The effect of this may be hard to predict. (Using the current mouse position would be even less predictable.) (31)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you wish to save a keyboard macro for longer than until you define the next one, you must give it a cell to store it in name using M-x save-last-kbd-macro. This reads a cell as an argument using the minibuffer and stores the macro in the cell. (32)
M-x store-last-kbd-macro RET cellname RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
One Line Programs Writing One Line Programs Long One Liners Multiple Commands in One Line Writing programs Writing Programs Commands in Programs Commands available in programs
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
M-x cell-number
will execute the commands in the cell.
For example, assume the cell cursor is located on cell A1
.
Enter the keystrokes (including the quotes and braces).
"{right-cell 4}" |
If you now type M-x A1
the cell cursor will be positioned in
E1
. Typing M-x A1
again, the cell cursor is positioned at
I1
. Some examples:
"{set-option status -1}"
"{print-region A1.F35 /tmp/out}"
/tmp/out
. The contents of the cells are truncated to fit in
their column's width. The result is a rectangular array. Notice that
there are no quotes around the file name.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To execute several commands at once, concatenate them in a cell. If `A1' contains
"{right-cell 1}{up-cell 1}" |
then typing M-x A1
moves the cell cursor one right and one up.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If commands are entered into a region named by a variable var,
then we can use M-x var
to execute the code.
Suppose that the contents of A1.A3
are given below , and that
region A1.A3
is named test1
. Typing
M-x test1
has the same effect as {up-cell 1}
.
"{right-cell 1}" "{up-cell 1}" "{left-cell 1}" |
If `filename' contains a list of Oleo
commands (like the
`.oleorc' file), the commands in this file can be executed:
The syntax for a command is a command name followed by a whitespace separated list arguments. For example:
|
Blank lines and lines that begin with `#' are ignored. Lines may be continued by preceeding the final newline with an odd number of `\\' characters. One backslash and the newline will, be discarded.
The commands in the next file perform some arithmetic operations on an already loaded spreadsheet. Note that the division is protected against division by zero.
goto-cell r3c84 edit-cell ((rc82-rc3)/if(rc4=0,0.5,rc4) )^2 + \ ((rc82-rc5)/if(rc6=0,0.5,rc6) )^2 goto-cell r3c85 edit-cell rc[-1]/36.0 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The commands available in programs are listed in the command index (see section 17. Command Index). For more information, look at the online help for the individual entries.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
What a key does when it is pressed depends on the context. The listing of actions associated with a key in a given context is called a 'keymap'. Keymaps may have a 'default map'. If a key is pressed which does not have an assigned meaning in that map, the map's default map is checked, and that map's default map, until a command is found or there are no more default maps to scan.
The different keymaps, and their usage are as follows:
universal The root of all keymaps. help Help commands. mouse Bindings for mouse buttons. navigate Commands that move the cursor. trolx-navigate Navigate commands prefixed by C-x meta-navigate Navigate commands prefixed by ESC. main The default keymap. trolx Default C-x commands. meta Default ESC commands. digit The numeric prefix keymap. edit The keymap for editing in the input area. meta-edit Edit commands prefixed by ESC. trolx-edit Edit commands prefixed by C-x. ansi ANSI arrows keys. |
The diagram below shows the relationship between the various keymaps. The keymap to the left of a given keymap is its default.
|
M-x bind-key
M-x bind-key RET main RET up-cell C-1 RET |
M-x describe-key
M-x write-keys
f commands
to a file that, when
executed with read-commands, will return the keymaps to their
current state. To write a list of commands to the file
`/tmp/name', type
M-x write-keys RET /tmp/name RET |
M-x read-commands
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Cell functions take a comma-separated list of arguments in parentheses, and return a value based on those values. In addition to the standard value types, some arguments may be cell ranges.
Boolean functions and, or, not, etc. Math functions Elementary mathematical functions String functions String manipulation functions. Structural functions Info about the structure of the spreadsheet. Search functions Search for cells by value, string, etc. Business functions Business stuff. Date functions Time and date manipulation. Gsl functions GSL (GNU Scientific Library) functions.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Boolean functions return either a #TRUE
or #FALSE
value.
Most arguments (those labelled bool) are also boolean. If these
arguments have any other value instead, the function returns
#NON_BOOL
as an error.
if(bool, val1, val2)
#TRUE
, then val1 is returned. If
bool is #FALSE
, val2 is returned.
and(bool1, bool2)
#TRUE
if and only if both arguments are #TRUE
,
otherwise returns #FALSE
.
or(bool1, bool2)
#TRUE
if either or both arguments are #TRUE
,
otherwise returns #FALSE
.
not(bool)
#TRUE
if bool is #FALSE
; #FALSE
if
#TRUE
.
iserr(val)
#TRUE
if val is an error, #FALSE
otherwise.
isnum(val)
#TRUE
if val is a number, or can be automatically
converted to a number. Thus, isnum("12")
is #TRUE
, while
isnum("foobar")
is #FALSE
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
General math functions log, sqrt, etc. Trigonometric functions Trigonometric functions Statistical functions Statistical functions
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For these these functions, the argument x can be a number (integer
or floating point), a reference to a cell containing an integer, or a
reference to a cell containing a quoted integer. Thus, if cell
(34)
A2
contains "-12.34"
,
then all of the following expressions compute the absolute
value of -12.34:
@abs(-12.34) @abs(A2) @abs(@cell(2,1,"value")) |
abs(x)
negate(x)
int(x)
int()
converts x to an integer by truncating
the fractional part. For instance,
int(2.3) => 2 int(-2.3) => -2 |
ceil(x)
ceil()
replaces x by the least integer greater than or
equal to x.
ceil(2.3) => 3 ceil(-2.3) => -2 |
floor(x)
floor()
replaces x by the largest integer less than or
equal to x.
floor(2.3) => 2 floor(-2.3) => -3 |
log(x)
exp(x)
log10(x)
sqrt(x)
rnd(x)
M-x set-option RET ticks 10 RET |
fixed(x, places)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pi()
sin(ang)
cos(ang)
tan(ang)
asin(val)
acos(val)
atan(val)
dtr(deg)
dtr
converts degrees to radians.
rtd(rad)
rtd
converts radians to degrees.
atan2(y, x)
atan2
is
(-pi..pi).
The quadrant of the angle returned is determined by the quadrant of the
point (x, y).
hypot(x, y)
sqrt(x*x + y*y)
.
(See section 11.2.1 General Math Functions).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions take a variable number of arguments, labeled
vr1, vr2, etc. Each of these values can be a
numeric type or a range. If the value is a range, the values of all
numeric cells in that range are used (strings, empty cells, etc. are
ignored). Values can also be strings that are easily convertible to
numbers; i.e., "123"
.
If none of the arguments include valid numbers, then the value of the
function is #NO_VALUES
. To ensure that the expression doesn't
return an error in such cases, you can provide a default value as an
extra argument (e.g., @sum(0,r1:10c1:10)
).
The spreadsheet below is used for examples of the statistical functions.
|
sum(vr1, ...)
prod(vr1, ...)
count(vr1, ...)
max(vr1, ...)
min(vr1, ...)
avg(vr1, ...)
std(vr1, ...)
@sqrt(@var(...))
.
var(vr1, ...)
@std(...)^2
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Strings indexes start with 1 for the first character. Indices less
than 1 or greater than the length of the corresponding string will
generate an #OUT_OF_RANGE
error return, unless otherwise noted.
These functions are in the `string' package. If Oleo is compiled with `-DUSE_DLD', the string package must be loaded before these functions can be used. If a spreadsheet that uses these functions is loaded before the string package is loaded, things will fail (silently!). This is a bug.
len(str)
strupr(str)
strlwr(str)
strcap(str)
trim(trim)
find(str1, str2, pos)
substr(pos1, pos2, str)
mid(str, pos, len)
edit(str, pos1, pos2)
substr
.
repeat(str, num)
repeat("foo", 2)
returns "foofoo"
.
concat(vr1, ...)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions return information about a cell or range of cells. Some of them are in the `cells' package; if Oleo is compiled with `-DUSE_DLD', the cells package must be loaded first.
row()
col()
rows(rng)
cols(rng)
my(key)
"row"
"column"
"width"
"lock"
"protection"
"locked"
or "unlocked"
.
"justify"
"alignment"
"left"
, "right"
, "center"
or "default"
.
"format"
"fmt"
"default"
, "user-1"
, etc.
"type"
"error"
, "boolean"
,
"float"
, "integer"
, "null"
, "unknown"
, etc.
"formula"
"value"
Any other value generates #BAD_INPUT
.
curcell(key)
my()
, but returns information about the cell where the
cell-cursor is.
cell(row, col, key)
my()
, but for the cell at (row, col). Be
careful about the indices in a0
mode. The cell in row 2, column
1 is A2
, not B1
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions search for a value or string in a range of cells, and
return the index of the first cell that matches. Cells are numbered
from 1 in column-major order; e.g., in the range r1:2c1:3
cell
r1c1
is index 1, cell r2c1
is 2, cell r1c2
is 3,
etc.
member(rng, val)
smember(rng, str)
members(rng, str)
members()
, but vice-versa: matches the first cell with a
substring of str (i.e., str is contained in the cell). If
str is empty, empty cells are still ignored (unlike
members()
).
pmember(rng, str)
memberp(rng, str)
smember()
and members()
, respectively, but these
search for an initial string str of the cells in rng.
index(rng, index)
index(rng, rowoffset, coloffset)
oneof(choice, val1, ...)
#OUT_OF_RANGE
is returned. If no value
arguments are supplied, #NO_VALUES
is returned. Note that
arguments must be values; ranges are not allowed.
These functions are used to index into a table of entries:
hlookup(rng, num, rowoffset)
vlookup(rng, num, coloffset)
vlookup()
, but vertically: scans the first column of
rng for a value greater than num, and returns the cell value
coloffset columns to the right.
vlookup_str(rng, str, coloffset)
vlookup()
, but looks for string str.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pmt(p, r, t)
pv(pmt, r, term)
npv(rng, r)
irr(rng, guess)
#BAD_INPUT
if it does not converge for the
given input.
fv(pmt, r, term)
rate(fut, pres, term)
term(pmt, r, put)
cterm(r, fut, pres)
sln(cost, scrap, life)
syd(cost, scrap, life, per)
ddb(cost, scrap, life, per)
syd()
.
anrate(pmt, pres, term)
anterm(pmt, prin, r)
balance(prin, r, term, per)
paidint(prin, r, term, per)
kint(prin, r, term, per)
kprin(prin, r, term, per)
compbal(prin, r, term)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Functions for manipulating date and time. Arguments named time are times in seconds, either an arbitrary count or from a specific epoch (i.e., local time), unless otherwise noted. Here are some examples. Assume that the date is December 16, 1994, and the time is 7:56 am. The left hand column is the command, and the right hand column is the result.
|
now()
ctime(time)
now()
.
hms_to_time(hours, minutes, seconds)
dhms_to_time(days, hours, minutes, seconds)
time_to_d(time)
time_to_h(time)
time_to_m(time)
time_to_s(time)
ymd(year, month, day)
ymd_dst(year, month, day, dst)
ymd_dst()
, if dst is positive,
daylight savings time is assumed; if 0, standard time; and if negative,
neither (i.e., the same as ymd()
).
local_year(time)
local_month(time)
now()
) return its
year or month in the local timezone.
local_date(time)
local_hour(time)
local_min(time)
local_sec(time)
local_isdst(time)
local_yday(time)
local_wday(time)
gmt_year(time)
gmt_month(time)
gmt_date(time)
gmt_hour(time)
gmt_min(time)
gmt_sec(time)
gmt_isdst(time)
gmt_yday(time)
gmt_wday(time)
get_date(date)
posix_date(date)
get_date()
, and as per the Posix standard for
posix_date()
.
strftime(format, time)
now()
). This function is implemented by the C
library function strftime()
. The following documentation
describes the GNU implementation of strftime()
. Your version of
Oleo may have been built with a different version, in which case, you
can find documentation in the strftime()
man page. (In the
future this anomaly will be removed).
Performs `%' substitutions similar to those in printf()
.
Except where noted, substituted fields have a fixed size; numeric fields
are padded if necessary. Padding is with zeros by default; for fields
that display a single number, padding can be changed or inhibited by
following the `%' with one of the modifiers described below.
Unknown field specifiers are copied as normal characters. All other
characters are copied to the output without change.
Supports a superset of the ANSI C field specifiers.
Literal character fields:
Numeric modifiers (a nonstandard extension):
Time fields:
Date fields:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The GNU Scientific Library (GSL) is a collection of routines for numerical computing. The routines are written from scratch by the GSL team in C, and are meant to present a modern Applications Programming Interface (API) for C programmers, while allowing wrappers to be written for very high level languages.
More information about GSL is available from http://sources.redhat.com/gsl/
Currently only a small subset of the GSL functions (as they are in GSL 0.6) are made available in Oleo. They're most of the statistical functions :
The API made available in Oleo for these functions differs slightly from
the native C API of GSL. The C API provides for a stride
and a number
parameter when passing a data array. In Oleo, both of these are not explicitly passed.
For example, the gsl_stats_mean
function has just one parameter in Oleo,
which is a range of cells from which it calculates the mean. oleo_gsl_stats_kurtosis_m_sd
has three parameters : a range of cells, and two numbers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
New at functions Adding new at Functions
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is easy to add new @ functions. Suppose that I want to add a greatest common divisor function. Here is a definition:
int gcd(i,k) int i,k; { int c; if ( i < 0 ) i = -i; if ( k < 0 ) k = -k; while ( k != 0 ) { c = k; k = i % k; i = c; } return i; } |
In Oleo, I would like to enter @gcd(6,20)
, and have the result
2
displayed. The following files need to be changed or created:
We will create a new class of functions called int_funs. For
simplicity, there is only one function, gcd
, in this class, but
there could be many more. In addition to the code given above for gcd,
we need an interface between Oleo and gcd.
static void do_gcd (p) struct value *p; { int arg0 = p[0].Int; int arg1 = p[1].Int; |
Next, we need to give information about the members of this new class of functions. The "II" refers to the two integer arguments. For more examples, see `busi.c'.
struct function int_funs[] = { {C_FN2, X_A2, "II", do_gcd, "gcd"}, {0, 0, "", 0, 0}, }; |
Oleo also (as of release 1.99.6) requires a function in each file to figure out how many new user accessible functions it contains. Look in busi.c for a simple example (init_busi_function_count) which will probably work for your new functions as well. As you can see the function simply takes information from the above array and offers it to another Oleo module.
Finally, we need some standard headers and defines. These are probably not all necessary.
#include "funcdef.h" #include "sysdef.h" #include "global.h" #include "cell.h" #include "eval.h" #include "errors.h" |
It's polite to add information about new functions. This information can be added in an appropriate place in `forminfo.c':
"gcd", "find gcd gcd(a,b)", "" "The greatest common divisor of A and B.", 0, |
The byte compiler needs to be told about the new class of functions. We declare the new class of functions:
extern struct function int_funs[]; |
static struct function *__usr_funs[] = { date_funs, busi_funs, string_funs, cells_funs, int_funs, }; |
The file `my-new-functions.c' needs to be added to the list of source files. Editing the file src/Makefile.am and adding to the list of files named oleo_SOURCES will do :
oleo_SOURCES = parse.y byte-compile.c eval.c ref.c \ decompile.c sort.c regions.c utils.c lists.c\ io-term.c io-utils.c io-x11.c window.c io-edit.c\ line.c key.c format.c funcs.c \ hash.c ir.c io-curses.c font.c display.c init.c \ sylk.c oleofile.c sc.c list.c busi.c string.c cells.c \ cmd.c basic.c args.c \ stub.c input.c info.c help.c \ graph.c plot.c \ forminfo.c posixtm.y date.c xrdb.c \ $(GUI) $(XBSRC) $(MYSQL) \ print.c postscript.c pcl.c epson.c prtext.c \ my-new-functions.c |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you have problems with Oleo or think that you have found a bug, please report it; we cannot promise to do anything but we might well want to fix it.
Before reporting a bug, make sure you have actually found a real bug. Carefully reread the documentation and see if it really says you can do what you're trying to do. If it's not clear whether you should be able to do something or not, report that too; it's a bug in the documentation!
Before reporting a bug or trying to fix it yourself, try to isolate it to the smallest possible Oleo program and input data file that reproduces the problem. Then send us the program and data file, some idea of what kind of Unix system you're using, and the exact results Oleo gave you. Also say what you expected to occur; this will help us decide whether the problem was really in the documentation.
Once you have a precise problem, send e-mail to `bug-oleo@prep.ai.mit.edu'.
Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are just obscure features, send a note to `bug-oleo@prep.ai.mit.edu'.
Also, if you wish to add to the documentation, please do so. Send your additions to the address above.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Motif is a toolkit for building graphical user interfaces (GUIs) with the X Window System.
Such a GUI has been built for oleo. The combination of oleo and its Motif interface comes close to professional quality spreadsheets that one can buy off the shelf.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When this manual talks about Motif, it refers to what is commonly referred to as OSF/Motif, a user interface toolkit for the X Window System which was originally developped by the Open Software Foundation (OSF). The OSF has merged with X/Open, the new name of the organisation is The Open Group.
A free implementation of Motif, called LessTif, which is available from the LessTif home page, can be used instead of Motif.
LessTif is covered by the LGPL (Library General Public License).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Advantages to using either the Motif or the GTK interface to Oleo are the same as for any GUI: users with little experience will find it easier to get started with the application. The GUI interfaces also happen to be more aesthetically pleasing.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A user of Oleo typically only needs a recent Oleo distribution, which he installs through his operating system's standard mechanism.
Someone who's building Oleo from sources will need several packages that Oleo depends on :
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Another toolkit for building GUIs is GTK. It is also freely available, and another user interface for oleo may be built with it too.
GTK is the FSF's official GUI toolkit.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The mouse is used in the same manner as in any Motif application.
The top of the Oleo window is a horizontal bar which is called the menu bar. It consists of a small number of buttons (represented by words such as File, Edit, ...).
Using the mouse to point at such a word, you can click MB1 on such a button to make a pulldown menu appear. MB1 is usually the left mouse button.
The words in these pulldown menus are action buttons which should perform actions that the user can understand.
You can select a cell in the spreadsheet by clicking MB1 in it. Once a cell is selected, its position and current value are displayed in a status area in the upper left of the Oleo window (just below the menu bar). The area to the right of that is the formula editor: it displays the formula on this cell, if any.
Formulas should be edited in the formula editor.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Using the method described above you can pull down a menu which reveals
a number of action buttons. These buttons typically contain a text such
as Open Ctrl-O
.
Additionally, the O is underlined.
The Ctrl-O means that you can press down the Control key on your keyboard, and while doing that, depress the O key. This should activate the button.
The underlining means that once you've pulled down this menu, you should be able to activate this button by just the O key.
The pulldown menu, which was indicated by the word File (with underlined F), can in itself be triggered by pressing the Alt key and depressing the F key.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you have a version of oleo that has been built with Motif support, but you don't currently have an X Window System display (for instance you're using a dialup connection), then it is still possible to use the curses based character user interface.
The command oleo -t
should start Oleo with a curses based user interface,
even if you're running in an X environment.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can put a button in a cell in the Motif version.
The formula of the cell that you want to have a button should be
button("text", "cell-specification")
The first argument is the text that the button will show, the second argument
is the cell whose content will be executed. That cell will typically contain a
command like psprint-region r3:45c8:13 invoice.ps
Note that this is currently an experimental feature.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
15.1 Database Access Introduction 15.2 MySQL 15.3 Xbase
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Oleo can interface to database management systems (DBMSs) in more than one way.
This is work in progress though, we expect the implementation to evolve quite a bit from the current status.
Currently there are three ways of accessing databases from Oleo :
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can get a value from a database into a cell by putting a statement like
@mysql_query("select max(salary) from salaries") |
in the cell.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
better than the high priced spread
Note that the current range is given as upper-left corner to lower-right corner, even if the mark is to the lower left of the cursor (or vice versa). This is confusing.
the doc doesn't seem to agree with the behavior; what is the intended behavior? the repeat counts seem to be ignored.
This is always cell A1
in
the current version, but supposedly might change in the future.
why -1?
should these be changed - emacs uses 1 for 0, 2 for 1, and 3 for 2
where is info on file formats?
what is the default
But what does this really do?
what else can go here? can I set the default font here?
This will be improved in the future.
This can be subtle - some good examples are needed
is this fixed?
this does not appear to be implemented
Should the set-user-format command check its input for validity?
what is the unit of height
is it?
example? it it `M-x set-option list ","'?
is it?
I don't understand this
nor do I understand this one
actually, this does not print correctly - ghostscript gives an error
I don't understand them
is it
what?
example?
gnuplot has 9 styles; should these be added?
this is not a good choice
does repeat count work?
does it - it should
is this correct?
isn't this C-x =?
yes it's trivial - how about something complex!
how do I make a reference to a cell?
Actually, due to a bug in version 1.5 str1 is searched for in str2.
In version 1.5 this function counts indices from 0 instead of 1 as with other string functions; this is probably a bug.
An empty cell is a cell with no value; a cell with an
empty string value (""
) would match anyway, since an empty
string is a substring of an empty string.
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | previous or up-and-previous section | 1.1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next or up-and-next section | 1.3 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | concept index | |
[ ? ] | About | this page |