CST variable

### 3.3.10 CST variable

The menu available with the cust button in the bandeau on the onscreen keyboard (see Section 2.2, item 2.2) is defined with the CST variable. It is a list where each list item determines a menu item; a list item is either a builtin command name or a list itself consisting of a string to be displayed in the menu and the input to be entered when the item is selected.

For example, to create a custom defined menu with the builtin function diff, a user defined function foo, and a menu item to insert the number 22/7, enter:

CST:=[diff,["foo",foo],["My pi approx",22/7]]

Note that if the input to be entered is a variable and the variable has a value when CST is defined, then CST will contain the value of the variable. For example,

app:=22/7:; CST:=[diff,["foo",foo],["My pi approx",app]]

will be equivalent to the previous definition of CST. However, if the variable does not have a value when CST is defined, for example:

CST:=[diff,["foo",foo],["My pi approx",app]]:; app:=22/7

then CST will behave as the previous values to begin with, but in this case if the variable app is changed, the the result of pressing the My pi approx button will change also.

Since CST is a list, a function can be added to the cust menu by using the concat command (see Section 6.3.12):

CST:=concat(CST,evalc)

will add the evalc command to the cust menu.