5. Embedded QUEL for Ada : EQUEL Statement Syntax for Ada : Comments
 
Share this page                  
Comments
Two kinds of comments can appear in an EQUEL program, EQUEL comments and host language comments. EQUEL comments are delimited by two hyphens (- -), and continue till the end of the line, or by /* and */, and can continue over multiple lines.
Both styles of comments appear on lines beginning with the ## sign. Whereas the preprocessor passes Ada comments through as part of its output, it strips EQUEL comments and does not pass them through. Thus, source code comments that you desire in the preprocessor output should be entered as Ada comments, on lines other than EQUEL lines.
The following restrictions apply to any comments in an EQUEL/Ada program, whether intended as EQUEL comments or Ada comments:
If anything other than ## appears in the first two positions of a line of EQUEL source, the precompiler treats the line as host code and ignores it. The only exception to this is a string-continuation line (see String Literals).
Comments cannot appear in string constants. In this context, the intended comment will be interpreted as part of the string constant.
In general, EQUEL comments are allowed in EQUEL statements wherever a space may legally occur. However, no comments can appear between two words that are reserved when they appear together, such as declare cursor. Please refer to the list of EQUEL reserved words in the QUEL Reference Guide.
The following additional restrictions apply only to Ada comments:
Ada comments cannot appear between component lines of EQUEL block-type statements. These include retrieve, initialize, activate, unloadtable, formdata, and tabledata, all of which have optional accompanying blocks delimited by open and close braces. Ada comment lines must not appear between the statement and its block-opening delimiter.
For example:
## retrieve (ename = employee.name)
   --Illegal to put a host comment here!
## {
    --A host comment is perfectly legal here 
    put ("Employee name: "& ename);
## }
Ada comments cannot appear between the components of compound statements, in particular the display statement. It is illegal for an Ada comment to appear between any two adjacent components of the display statement, including display itself and its accompanying initialize, activate, and finalize statements.
For example:
## display empform
--Illegal to put a host comment here! 
## initialize (empname = "Fred McMullen")
--Host comment illegal here! 
## activate menuitem "Clear"
## {
--Host comment here is fine 
##     clear field all
## }
--Host comment illegal here!
## activate menuitem "End"
## {
##     breakdisplay
## }
--Host comment illegal here!
## finalize
The QUEL Reference Guide specifies these restrictions on a statement-by-statement basis.
On the other hand, EQUEL comments are legal in the locations described in the previous paragraph, as well as wherever a host comment is legal. For example:
## retrieve (ename = employee.name)
##--This is an EQUEL comment, legal in this
##--location and it can span multiple lines
## {
      put ("Employee name: "& ename);
## }