Strings

The calculator has limited basic support for strings. Strings come in handy when passing in a function reference and for making function outputs more meaningful. Strings appear in the calculation surrounded by quote marks, but in the result they appear without the quote marks.

Entering a string on the stack

Strings are very simple to enter on the stack. All you do is proceed whatever you type in the register with quote marks {"}. An ending quote mark is not necessary unless you want do more than one stack entry from the register at a time, in which case you will need quote marks to indicate the end of the string.

Calculations with strings

Strings currently support only one type of calculation, and that is addition. Two strings may be added together (concatenated), or a string may be combined with a regular expression. In the latter case, the expression is evaluated into a numerical result, and the number is turned into a string to be concatenated with the other string. For example, if the following commands are entered:

"The result is: " 2 3 + +

The result will look like this:

The result is: 5

Future string support

In a future release it is planned that strings will support the following basic operations:

  • Indexing
  • Standard numerical output formatting (i.e. "G5") when converting calculations to strings.
  • Vertical output for string sets
  • Length function

If you need more string functionality than this, consider writing the developer at john@linstrum.net and let him know what you need.