!NOT a SpreadSheet (NSS)

 A REX 6000 ADDIN  by John Del Ferro

 

 

Description: 

NSS is a configurable 12 variable (cell) expression evaluator that supports many mathematical functions.  It acts similar to a 12 cell spreadsheet or ¡°worksheet¡± similar to those included on business and engineering calculators.  NSS is configurable by a user defined text file called an ¡°expression file¡±.   This file defines the variables and calculations and outputs for each expression.  Values of input variables are entered into the cells of NSS and the calculations specified in the ¡°expression file¡± are performed and displayed.  A default expression file is included.  The user can create additional expression files of their own.

 

Release Notes:

This version is all new.  If you are a 1.??? user then you should delete all old files including the old math library and re-install these files.  Also for old users, the text memo named ¡°rexNSS_Sample¡± MUST be renamed ¡°rexNSS_1¡±.   This readme file is completely new and includes detailed information not previously published!  See the OPERATION section for the program features.

 

Contact:

For more information on this package see http://www.delferro.net/rex

To contact the author, John Del Ferro, send email to rex@delferro.net

I cannot guarantee support; however, I will try to assist as time permits.  At the web site is a discussion forum with many useful threads of past users questions and answers.

 

Distribution:

Program:   !NOT a SpreadSheet (NSS)

Version:     2.0a (04APR2003)

Author:       John Del Ferro

Platform:    REX 6000 and Citizen DS2

Copyright:  Copyright (C) 2002 2003 John Del Ferro

NSS For Rex 6000 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.  NSS For Rex 6000 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  You should have received a copy of the GNU General Public License along with this program (in the file COPYING); if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 

 

Create and Share your expressions!

 

The possibilities are unlimited.  Please share your expression files with everyone by going to the forum/bulletin board at the web site.   Also if you need assistance creating an expression file, just email me and I will create it for you.


 

DESCRIPTION OF SAMPLE EXPRESSIONS INCLUDED IN PACKAGE

 

Expression Name

Description

SimpleSum&Avg

Sums Up to five entered values and will calculate the average if you enter the number of items as well.

Sample Funcs;

Demonstrates use of powers, roots, logs, etc¡¦.

Present/Future Vals;

Left Side configured to do a PRESENT VALUE calculation.  Right side configured to do a FUTURE Value calculation.

Loan Amort;

This function does AMORTIZATION of a Loan.  I.e. Calculate a MONTHLY payment for a given Loan Amount, Interest Rate, and Length of Loan in Months.

TRIG FUNCS;

Demonstrates trig functions.

Concrete Calc;

Custom Calculation for your FENCE CONSTRUCTION BUSINESS.  Estimates the amount of concrete you need to order when you enter the number of fence posts you need to install and the diameter and depth of the hole for the poles.

Temp Tax Calc;

Custom Calculation to determine the cost of a product when you have a designated price that includes all the taxes.  He needs to  back out the BEFORE TAX total for a given AFTER TAX total that has 2 TAXES applied to only 35% of before tax total.

Book&Disc Price;

Standard Business calculation for Book Price and List Price.

LABOR;

Custom Calculation for estimating LABOR costs for a job.  This business estimates labor as 2 times the discounted extended price.

Currency;

A Currency Converter.  I basically hard code the conversion rates in the expression memo and periodically update the memo manually.  On the left side I ENTER the US Dollar amount and it converts it into Five other currencies below.  On the right side I enter KOREAN WON and it converts it into the same 5 currencies.

 

 

Installation

 

The NSS package is comprised of the NSS ADDIN file, a Math Library ADDIN file and a text memo ¡°expression file¡±.   The ADDIN files should be installed on your rex using RexTools.  The text memo expression file may be loaded to your rex through MSOutlook or by RexTools.  An additional sample text memo expression file is also included.  The four files are described below.

 

1)  NSS.rex :  This is the !NOT A SPREADSHEET ADDIN.   It must be loaded on the rex.  Prior to running NSS you should make sure the Math Library is installed and the CONFIGURATION TEXT FILE is loaded as a MEMO.   NSS will halt/exit if the text file is not found. This file can be loaded into any addin slot including Chris Harris¡¯s ¡°ADDER¡±, ¡°and ¡°BGON¡± addin slots

 

2) jML_lib.rex:  A Math Library ADDIN that supports NSS.  You must load this file, but there is no need to run this file.  Other addins by delferro may also call this library.  You only need to load it once.  NOTE: ALL PREVIOUS VERSIONS OF THE MATH LIBRARY should be deleted from your system.  This file can be loaded into normal addin slots and Chris Harris¡¯s ¡°ADDER¡± slots.  I do not think it can be loaded into the ¡°BGON¡± slots.

 

3) rexNSS_1 : This is a required Expression File Memo.  The provided sample includes several FINANCIAL CALCULATION EXAMPLES.  It must be loaded before running NSS.  NSS will always look for a memo titled ¡°rexNSS_1¡±.  IT IS CASE SENSITIVE.  You can edit and change rexNSS_1 to perform your own calculations.  Also, from within NSS you can specify different expression files to load; however, rexNSS_1 will always be loaded on start-up. 

 

4) rexNSS_2 : This is another sample Expression File Memo.  It is a small worksheet for doing currency conversions.  When you are running NSS you can select ¡°File¡± and enter this file name to load it. 

 

OPERATION

 

*   The program starts by loading the expressions contained in the default expression file ¡°rexNSS_1¡±. The default file MUST EXIST and MUST BE named rexNSS_1.  The current file name is displayed on the second line of screen.

*   Select a different expression from the current file using the left/right arrows ¡°©¬à¡±.  This will scroll through the different expression in the currently open expression file.  The name of each expression is displayed on the third line.

*   You can have up to 9 different worksheets/expressions in one expression file.

*  Use the ¡°FILE¡± button to enter the name of an expression file other than the default file.   You can name other expression files any name you want; however, I recommend using rexNSS_2 or rexNSS_a, etc¡¦  This makes it easy to enter a new file name in the rex keyboard since  you can just hit ¡°backspace¡± to delete the ¡°1¡± from the default file name and simply type ¡°2¡± and ¡°enter¡±.  I recommend using a category for the expression files, but it is not required.  I use a category called ¡°rexNSS¡± so that in Outlook and on the Rex and I can see all my memos together by category.

*   Mathematical Expressions Supported:  addition, subtraction, multiplication, division, Parenthesis; sin, cos, tan, atan, atan2, deg, rad; powers, ex, ln, log10, and any algebraic combination of these functions.

*   Input variables are marked with an ¡°X¡± on the worksheet screen.  All other variables are output variables.   To enter a value for the cell, tap on the cell marked with an ¡°X¡±.  The rex keyboard will pop-up and you simply enter the numerical value for input.   As soon as you press enter and return to the worksheet the calculation is performed based on the values currently displayed. 

*   BE CAREFUL; The result is always calculated even if you have BAD INPUT!! THERE IS NO ERROR CHECKING in the code. 

*   Use the ¡°EXIT¡± button to close the program.  Also can use ¡°HOME¡± button.


 

Anatomy of an Expression in NSS

Creating your own expression file is the key to the usefulness of NSS.  This section lists the basic symbols and logic you need to write your expressions.  Use this along with the included samples to learn how to do it!   The next section also includes a detailed explanation of a complete expression included in the sample.

 

FEATURE/CODE

DESCRIPTION

EXAMPLE

A,B,C,D,E,F,

G,H,I,J,K,L

Internal Variable Names.  These names are used internally and for defining the calculations.  (12 variables)

 

;

END OF LINE.  EACH line MUST end with a ¡°;¡± and CR/LF or CR.  A Line Length is limited to about 64 characters.

$ all lines end in semi-colon;

$

Indicates a COMMENT line in the expression file.

$ this is comment;

#FUNCTION title;

A descriptive title of the expression. Limit it to about 19 characters for display.  Make sure there is NO SPACE between the # and F.   This applies to all use of the ¡°#¡±in this file.

#FUNCTION Mortgage   ;

#VARIABLES;

Marker identifying the start of variable definitions.

#VARIABLES;

A#name;

Display Variable Names.  Defines the description to be displayed on the screen for each variable.

A#PRINC;   

D#PAYMNT;

A~I;

 

Defines an INPUT variable.  By default all variables are CALCULATED RESULT variables.  You need to specify the INPUT variables.  On the screen an INPUT variable will have an ¡°X¡± displayed.  Tapping on the variable will bring up the keyboard so you can enter a numerical value.

A~I;B~I;

#CALCS;

 

Marker identifying the start of the calculation definitions.

#CALCS;

 

#STOP;

Marker identifying the END of the complete definition of the expression.  A new expression can begin after this.  Each function MUST have a STOP.

#STOP;

+, - , * , / 

 

A=B+C;  A=B-C;

A=B/C;   A=B*C;

^  Power

C=A to the B power

C= A^B;

   Roots

C=A to the (1 over B) power

C =A^(1/B);

   Any Power

D = A to the (B over C) power

C =A^(B/C);

   Other roots

C = square root

C = B^0.5;

LOG()

J= Natural Log of D

J=LOG(D);

EXP()

J = ¡°e¡¯¡± to the F

J=EXP(F);

LGD()

J = Log Base 10 of E

J=LGD(E);

SIN()

COS()

TAN()

Trig Functions are performed using  DEGREES

B=SIN(A);

C=COS(A);

D=TAN(A);

DEG()

RAD()

Convert A degrees to Radians

Convert B radians to Degrees

G=DEG(B);

G=RAD(A);

()

Parenthesis;  May be used.  It is recursive so don¡¯t use too many.  Use variables to cut simply the computation and reduce recursiveness.

D=A*(E/12);

F=(EXP(D*LOG(1+D)));

 


 

Detailed explanation of the Loan Amortization Expression.

 

 

LINE

EXPRESSION FILE CONTENTS

EXPLANATION

1

$ ---------------------------- ;

Comment Line

2

#FUNCTION Loan Amort ;

Title of Function to be displayed on Screen.  This function does AMORTIZATION of a Loan.  I.e. Calculate a MONTHLY payment for a given Loan Amount, Interest Rate, and Length of Loan in Months.

3

#VARIABLES;

VARIABLE MARKER

4

A#PRINC;B#RATE%;

Screen display for variables A, B

5

C#MONTHS;D#PAYMNT;

Screen display for variables C, D

6

A~I;B~I;C~I;

Variables A,B,C are INPUT variables. All other are output variables.

7

#CALCS;

CALCULATION MARKER

8

E=B/100;

E converts B percent to a decimal.

9

D=A*(E/12)/(1-1/(EXP(C*LOG(1+E/12))));

This is the full calculation. Look it up in a financial text book!   E is divided by 12 because this version uses a MONTHLY payment but the inputted RATE is an ANNUAL RATE.

10

#STOP;

Ends the Function.

11

$ ---------------------------- ;

Comment Line.

 

 

CREDITS

 

My wife, who doesn¡¯t give me a hard time for spending so much time on this project!

 

The rexdk development kit from Dan Schmidt and others who have developed the tools I used to create the programs for the REX 6000.  Links and other information related to the development kit can be found at www.rex6000.org maintained by Dana (danabw).

 

 

Copyright 2002,2003 John Del Ferro