Memory and Variables
ABCalc supports so-called memory of unlimited size. The memory consists of memory cells ("variables" in programming). Each memory cell has a distinct name. The names are not case-sensitive, so "A" and "a" denote the same cell (variable).
You use the content of memory cells by specifying their names in expressions in the place of values.
Reserved names
Cells mc0-mc9 are predefined as they are accessible via memory buttons in the ABCalc interface.
Also, constants cannot be used for memory cells and cannot be re-assigned.
Storing memory contents
Memory contents are not preserved across sessions; they disappear after you close the application.
Assignment of Values
You can create or update a memory cell by assigning a value to it using ":=" as an assignment operator:
a := 1
or, if the option to use = for assignment is set, simply as
my_cell = 1
Indexed Access
If a memory cell (variable) contains a string or a list, individual elements and slices can be obtained in the same way as they are obtained from values:
mc0 := "abcdefg";
mc0[3] // will yield 'd'
mc0[3..5] // will yield "def"
You can update individual elements of the values contained in memory cells (variables) too:
mc0 := "abcdefg";
mc0[3] := 'X';
mc0[2..4] // will yield 'cXe'