5. Embedded QUEL for Ada : Ada Variables and Data Types : Variable and Type Declarations : Concluding Example
 
Share this page                  
Concluding Example
The following example demonstrates some simple EQUEL/Ada declarations:
## package Compiled_Forms is
## empform, deptform: Integer; -- Compiled forms

pragma import_object( empform );
pragma import_object( deptform );
## end Compiled_Forms;

with Compiled_Forms; use Compiled_Forms;

## package Concluding_Example is

## MAX_PERSONS: constant := 1000;
## dbname: String(1..9) := "personnel";
## formname, tablename, columnname: String(1..12);
## salary: Float;
## type DATATYPES_REC is -- Structure of all types
##   d_byte:   Short_Short_Integer;
##   d_word:   Short_Integer;
##   d_long:   Integer;
##   d_single: Float;
##   d_double: Long_Float;
##   d_string: String(1..20);
## end record;
## d_rec: DATATYPES_REC;
## -- Record with a discriminant
## record PERSONTYPE_REC (married: in Boolean) is
##   age: Short_Short_Integer;
##   flags: Integer;
##   case married:
##     when TRUE =>
##        spouse_name: String(1..30);
##     when FALSE =>
##        dog_name: String(1..12);
##   end case;
## end record;
## person: PERSONTYPE_REC(TRUE);
## person_store: array(1..MAX_PERSONS) of PERSONTYPE_REC(FALSE);

## ind_var: Short_Integer := -1; -- Indicator Variable

## end Concluding_Examples;