[vox-tech] openoffice spreadsheet - named constants?

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sun Feb 20 12:57:24 PST 2005


On Sun, 20 Feb 2005, Peter Jay Salzman wrote:

> I want to do calculations in OO spreadsheet with a constant called hbar.
> 
> One way to do that is to have a cell, somewhere, with the number in it.
> 
> But is there a way to define named constants in OO so I don't have to put
> hbar in the sheet itself?  In other words, is there a way to "hide" the data
> definition but have that data available for use in calculations within the
> spreadsheet?

When you try to explain grep to a typical Windows user, you usually have
to spend some time explaining other things like command lines, standard
output and input, and pipes first.  There are similar issues in various
GUI environments, and your question makes me think your vocabulary is
part of the problem here.  (I got started using linux as much because I
wanted to understand its paradigms as because it is Free.)

A Calc file is a "Spreadsheet"... spreadsheets are collections of items of
type "Sheet".  Sheets contain "Cells".  A "Range" is a group of one or
more (possibly non-contiguous) cells.  This last point was tricky for me
to grasp... to specify a particular cell you use syntax that is general
enough to specify a range, so many things you might think of doing to
cells are actually done to ranges with cells treated as a subset. A "Name"
is a syntactic shorthand for a range.

So...

> is there a way to define named constants in OO so I don't have to put
> hbar in the sheet itself?

... when you say "sheet", the answer is too easy: put the named range in
another sheet in the same spreadsheet.  But given the terminology you are
using, some other points seem worth making:

a) there is no supported mechanism for defining named constants in this
computing paradigm (modelled after Excel)... the official mechanism for
making "pi" available is to call the "PI()" function.

you can create your own functions written in StarBasic if this approach
appeals to you.

http://documentation.openoffice.org/HOW_TO/various_topics/How_to_use_basic_macros.sxw

b) It is possible to reference cells in other spreadsheets, but
prone to breaking if you move the spreadsheet from its original directory.

http://documentation.openoffice.org/faqs/spreadsheet/016.html

c) in reference to "hiding" things... you can also set the height of a row
or the width of a column to zero if it is just an issue of appearance.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------



More information about the vox-tech mailing list