Concluding Example
The following example demonstrates some simple EQUEL/BASIC declarations:
## declare ingres
## declare byte d_byte ! Variables of each data type
## declare word d_integer2
## declare long d_integer4
## declare integer d_integer_def
## declare single d_real4
## declare double d_real8
## declare real d_real_def
## declare decimal(6,2) d_decimal
## declare string d_string
## declare integer constant num_depts = 10 ! Constant
## common(globs) real e_raise ! Static storage variables
## map (ebuf) string ename = 20
## dim string emp_names(100,30) ! Array declarations
## declare integer dept_id(10)
## common(globs) string e_address(40) = 30
## record person ! Variant record
## byte age
## long flags
## variant
## case
## group emp_list
## string full_name = 30
## end group
## case
## group emp_directory
## string firstname = 12
## string lastname = 8
## end group
## end variant
## end record
## declare person p_table(100) ! Array of records
## external integer empform, deptform ! Compiled forms
## dim word indicators(10) ! Array of null indicators