5. Embedded QUEL for Ada : Precompiling, Compiling and Linking an EQUEL Program : Coding Requirements for Writing EQUEL Programs : Ada Blocks Generated by EQUEL
 
Share this page                  
Ada Blocks Generated by EQUEL
EQUEL statements that are associated with a block of code delimited by the braces { and }, or begin and end, are called block-structured statements. All the EQUEL block-structured statements generate Ada blocks. If there is no code contained in the block, EQUEL may need to generate the Ada null statement, depending on the type of Ada block generated. Consequently, if you do want an empty block, do not place just an Ada comment inside it (without the ## to delimit the comment), because the preprocessor would consider the comment to be Ada host code and would treat the block as a block containing Ada code.
For example, to disable the scrolling down of a table field, you might mistakenly code the following activate block:
## activate scrolldown employee -- this example contains
                                -- an error
## 
   -- Disable scrolling of table field
##
The Ada comment in the block is considered Ada host code, and therefore, the null statement is not generated. This would later cause an Ada compiler syntax error. To resolve this situation, you must either let EQUEL know that the statement is only a comment, so that it will generate the null statement, or else code the null statement explicitly. The above example should be written as:
## activate scrolldown employee
## 
## -- Disable scrolling of table field
##
or
## activate scrolldown employee
## 
   -- Disable scrolling of table field
   null;
##