|
 |
|
|
Programming H2O Macros
As you've seen above, Overlays are program segments containing H2O code. Their placement in HTML documents enables dynamic web page creation. Below we look at the H2O language used inside these macros.
One Data Type Everything in H2O follows a single data type. Within this data type there are conventions in how numbers, Booleans, dates and times are written, but there is no need to declare types.
The data type used throughout H2O is a dynamically allocated two-dimensional array. The array has at least one column and one row. Each cell can store text, numbers, dates, dates and time, and Booleans. The size of any cell and the number of columns and rows of a variable is dynamic. The default value of a variable is a single cell table containing the word ERROR.
Variable Addressing Variables may be specified by name. A cell within a variable may be specified by following the variable name with a left square bracket, a column number, a comma, a row number and a right bracket. For example: refers to column 4, row 1 of the variable myvar. When the row is not specified it is equal to one.
H2O uses the "math convention." One specifies columns and then rows rather than rows and columns. Columns and rows start at one, not zero.
Booleans Booleans are the special words TRUE and FALSE. Functions in H2O that return Booleans, by convention, begin with the word IS, as in ISFILE or ISINTEGER.
|
|