| home | contents | previous | next page | send comment | send link | add bookmark |

Operation

SCalc's spread sheet is a rectangular array of cells containing text strings which can be edited individually by the user. Cells may contain either text or mathematical formulas. Cells containing mathematical formulas, functions, or literal numbers are evaluated to double type numbers and stored in the cell. Each cell is identified by column letter and row number. The cell identifier may be used as a variable in mathematical expressions.

When a cell is selected, its current contents are displayed on an edit line at the top of the screen. The Tab key enables editing of cell contents. Cell contents are edited using text editing keys. When Enter is pressed, a cell is evaluated. The entire spread sheet is evaluated using the Recalculate command. A message line below the text entry field shows the cell's status (empty, expression, or text) or shows where a syntax error has occurred.

This is what the spread sheet looks like:

A1 := 2 * 7.11
expression
AutoCalc Off
    |      A       |      B       |      C       |   . .
--  +--------------+
 1            14.22
--  +--------------+
 2
--
 3
--
 .
 .

Tab-edit  Q-quit  S-save  L-load  C-clear  R-recalc  A-auto

Cells in which the first token is = are processed as mathematical expressions; otherwise, they are assumed to be text strings and are not processed. The program will evaluate all cells starting at the column A; moving from row 1 to the last row; then to the next column until all cells are evaluated.

In the example above, the active cell is A1 which contains the expression: = 2 * 7.11 shown in the text entry field. The resulting value of the expression is shown on the spread sheet.

The following are examples of valid expressions (assuming the cell's used as variables are initialized):

= 2
= 3.14159
= a1 / ( b2 - c7 )
= sin( a1 ) * cos( a2 )
= 1.2 * ln( a1 + b1 ) + c1
= a5 * ( 4 + b3 / ( 5 - c4 ) )

Operators

SCalc mathematical expressions can use these operators grouped in order of evaluation precedence:

operationsymbol
exponentiation  ^
unary operations
default  +
negation  -
multiplicative operations
multiplication  *
division  /
remainder  %
additive operations
addition  +
subtraction  -

Parentheses are used to modify the operator precedence by creating sub-expressions.

Functions

The following standard functions included in SCalc:

functionreturns
abs(x)  absolute value of x
acos(x)  arccosine of x in radians
asin(x)  arcsine of x in radians
atan(x)  arctangent of x in radians
atan2(x,y)  arctangent of y/x in radians
ceil(x)  smallest integer greater or equal to x
cos(x)  cosine of angle x
cosh(x)  hyperbolic cosine of angle x
exp(x)  exponential value of x
floor(x)  largest integer less than or equal to x
hypot(y,x)  hypotenuse of a right triangle
ln(x)  natural logarithm of x
log(x)  base 10 logarithm of x
max(a,b)  larger of a and b
min(a,b)  smaller of a and b
sin(x)  sine of x
sinh(x)  hyperbolic sine of x
sqrt(x)  square-root of x
tan(x)  tangent of x
tanh(x)  hyperbolic tangent of x

Command menu

The normal command menu indicates a letter key for each command as follows:

Tab  edit selected cell
Q  quit exits SCalc
S  save current spread sheet
L  load a new spread sheet
C  clear current spread sheet
R  recalculate values of all cells in the spreadsheet
A  auto-calculate mode is toggled between on and off

Editing data

A cell is selected for editing by using the arrow keys on the keyboard. To edit an existing formula or text the user moves to the desired cell and press Tab to begin editing. When editing cell contents or a file name a different command menu is provided which shows:

Enter  finish editing
Tab  cancel editing

The following are the edit mode control keys:

left arrow  moves cursor to the left
right arrow  moves cursor to the right
Backspace  deletes the character to the left of the cursor
Delete  deletes the character at the cursor
Tab  exits and restores text
Enter  exits and processes changes


| home | contents | previous | next page | send comment | send link | add bookmark |

Copyright © 2004, Stephen R. Schmitt