Tutorial > Scientific mode and additional operations >


Reusing calculation sets

The Scientific mode supports saving and opening of single calculations in exactly the same way as the Standard mode. In addition, the Scientific mode supports saving and opening of a group of calculations called sets. This feature is intended for advanced users as both developing sets and using them requires good understanding on the way sets are handled by the system.

The set of calculations (or in short the 'set') you save is always the calculations available in the list (or history) part of the Pad EditCombo. A set comprises of one or more calculations which are usually related, that is have some common purpose.

Creating a set

The sequence of operations to create a set is as follows:

All the tasks above can be accessed from:
File sub-menu
In the example below, these tasks would be referred to directly assuming you know where to find them.

Set example

Let's assume that you want to create a set to calculate the area of a rectangle using the metric system.

First 'Clear all' calculations, memory, variables and history by pressing [Ctrl + Shift + Del] or [Ctrl + Shift + d]

Type the rectangle calculation as follows:
area = width * height
Test the above calculation; the Enter tasks starts automatically twice asking you to specify numeric values for the width and height respectively of the rectangle.

Assuming you enter 2 for the width and 5 for the height you get:
area=10

If you try to run the above calculation again you would find that the Enter task does not start again because the values for width and height are already defined (2 and 5 respectively). If you wish the application to ask these values again each time you run the calculation, assign a question mark '?' to both these variables as follows:
width=?
Result: width=?
and
height=?
Result: height=?

You would find now that each time you invoke the area calculation you would be asked to enter the values for both width and height.

At this stage the list (history) part of the Pad EditCombo is messy as it contains your various experiments so clean it using the 'Clean pad' command from the command sub-menu. This will result in a history looking something like this:
area = width * height
width=?
height=?

This is probably not the order of calculations you want but don't worry about it at this stage, just save the set:
File > Save user set to file
Call the set any name you want; for example, Rectangle_area.

Now you need to edit the set in Notepad:
File > Edit set in Notepad

You might want to change the calculation order as follows to make it clearer:
width=?
height=?
area = width * height

You might also want to make the set clearer by adding comments. The user can access these comments as explained further below. A comment starts with the hash '#' character. There are two types of comments; those that describe the purpose of the set and those that describe each calculation. Set comments are specified on individual lines at the top of the set and calculation comments are specified at the end of each calculation line.

After adding the comments the set might look something like this:
# Set for calculating the area of a rectangle
# Created by John Smith
width=? # Width in metres
height=? # Height in metres
area = width * height # Rectangle area

Save your set from Notepad in the original location (Press Ctrl + s to save and close Notepad).

Issue the 'Clear all' command to clear all calculations, memory, variables and history.

Open the set you just saved:
File > Open user set from file

You should find the above set of calculations in the Pad EditCombo list (history). The comments are not visible but you can access them at any time using the 'Info' keys as follows:
# 'Info' [Shift + F2] - Set information
'Info' [F2] - information about the calculation in focus
* 'Info' [Ctrl + F2] - The last opened set file name.

If you want to write comments which are not visible to users using the 'Info' keys combination above, simply insert two forward slashes '//' at the start of the line you want to comment for example:
// This is a private comment

It is important to note that calculation comments are associated internally with the variable that the calculation is assigned to, not to the calculation itself. This means that if you want to use calculation comments, you must assign different calculations to different variables otherwise comments will not match their intended calculations!

When you open a set, the variable assignments are loaded automatically; so for the example above: the
width=?
and
height=?
are assigned as if you performed these simple assignment calculations ready for use.

Similarly, if in your set you assigned a number to a variable, for example:
width=34
after you opened the set, the width variable would contain the number 34 as if you have performed this calculation.
In other words, the automatic variables' assignment described above makes the calculations in the set ready to use.

Sets are stored internally. If you want to share your sets with others or transfer them to another computer use the:
File > Export user set to file system

Similarly, if you want to use a set created by other users, you need to import the set:
File > Import set from file systems

SpeakOn CalcPad comes with a number of built-in sets termed 'provided sets'. You can explore and open these sets:
File > Open provided set

It is hoped to provide with time more built-in sets with SpeakOn CalcPad and the developer would welcome sets of general interest contributed by users.


[ Previous - Using string variables ]

[ Up - Scientific mode and additional operations - Section ]

[ Up 2 - Tutorial - Section ]

[ Up 3 - SpeakOn CalcPad Manual and Tutorial - Main Index ]