SED - Variables, Constants and Functions
All extension program source text is case insensitive except for literal strings.
These are names commencing with a letter and containing only letters, digits, periods (.) and dollar signs. A procedure or function can use at most 250 local variables. Local variables are private to the procedure or function and the same name used in another procedure refers to a different local variable.
These are names commencing with a dollar sign and containing only letters, digits, periods (.) and dollar signs. Global variables are common to all extensions and retain their values until the user leaves SED.
Global variables beginning with two dollar signs are reserved. Current usage of these names is:
Numeric constants are written as a sequence of digits, optionally prefixed by a sign or including a decimal point. A numeric constant with an absolute value of less than one must be written with a leading zero (e.g. 0.5).
A string constant may be enclosed in either single or double quotes. It may contain any character except the mark characters (which are available using the tokens shown below) and ASCII character 0 (nul).
The logical values are represented as 0 for False and 1 for True. In general, use of any value other than zero is treated as True by operations that expect logical values as their arguments.
The get.key function returns a code that relates to an internal function number. Each function has a corresponding symbolic name. These all begin with a period (.) and are the same as the comment inserted at the start of each line of a key binding record with spaces replaced by period. The names are:
Extension programs may examine the current state of many editor features by use of system variables. These all begin with a percent sign (%) and are read only (i.e. they cannot be used in a set function).
The following system variables may also be referenced in extensions:
A comment is introduced by an asterisk (*) and extends to the end of the line.
Extension programs may test whether the buffer being processed is read only. Attempts to change such a buffer are ignored. No error is displayed.
Variables are type variant in the same way as for QMBasic programs and they follow the same rules. In most cases, attempts to use a non-numeric value where a number is required result in use of a default.