Tutorial > Scientific mode and additional operations >


Using string variables

The Scientific mode supports variables in exactly the same way as the Standard mode. Although not mentioned explicitly, these are numeric variables meaning that they can contain only numbers and throughout this manual they are referred to simply as variables.

The Scientific mode supports another type of variable called string variables. A string variable can hold a string of characters which means any sequence of typed characters. To distinguish between numeric and string variables, a string variable name is marked with the prefix 's.'.

When a string variable is typed in a calculation its name is simply replaced with its string content. You can use a string variable anywhere in a calculation where you want part of a calculation replaced with the same sequence of characters but its use is mainly when you want to perform different calculations with the same arguments.

Consider the following example where you want to find the minimum and maximum of a sequence of numbers. To do this you would use the min and max functions so:
f.min(32,3,5,65)
Result: 3
and
f.max(32,3,5,65)
Result: 65

Notice that in the above example you had to type the same sequence of numbers '32,3,5,65' twice; typing the same numbers again is tedious and can lead to mistakes. You can perform the same calculations using a string variable; for example, let's call this variable 'data', so:
s.data=32,3,5,65
Result: s.data=32,3,5,65
The sequence of numbers is now stored in the string variable data.

You can do the previous calculations using the string variable data as follows: 
f.min(s.data)
Result: 3
and
f.max(s.data)
Result: 65

Note that in the example above if you want to perform the same calculations again with a different sequence of numbers, all you have to do is to assign the new sequence of numbers to the 'data' string variable and then perform the minimum and maximum calculations again. Furthermore you can save the calculations in the example above as a set for future use as described in the next page.


[ Next - Reusing calculation sets ]

[ Previous - Using additional functions ]

[ Up - Scientific mode and additional operations - Section ]

[ Up 2 - Tutorial - Section ]

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