Was this helpful?
Comments
Two kinds of comments can appear in EQUEL programs, EQUEL comments and host language comments. Host language comments are passed through by the preprocessor. EQUEL comments are not. Therefore, source code comments you want to retain in preprocessor output should be entered as host language comments.
EQUEL comments appear on lines with two number signs (##) as the first two characters. Pascal comments are on lines without ##. In EQUEL/Pascal programs, comments can be delimited by:
   /* and */
   { and }
   (* and *)
The following restrictions apply to any comments in an EQUEL/Pascal program, whether intended as EQUEL comments or Pascal 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. (For examples, 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. See the list of EQUEL reserved words in the QUEL Reference Guide.
The following additional restrictions apply to Pascal comments, only:
Pascal 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. Pascal 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! }
## begin
            { a host comment is perfectly legal here }
            writeln ('employee name ', ename);
## end
Pascal comments cannot appear between the components of compound statements, in particular the display statement. It is illegal for a Pascal 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 = 'Frisco McMullen')
         /* host comment illegal here! }
## activate menuitem 'clear'
## begin
         { host comment here is fine }
##     clear field all
## end
         { host comment illegal here! }
## activate menuitem 'end'
## begin
##     breakdisplay
## end
         { 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 }
## begin
         writeln ('employee name ', ename);
## end
The EQUEL/Pascal comment can be either of the two standard Pascal comments, delimited by (* and *) or { and }, or the QUEL comment, delimited by /* and */. For example:
## message 'No permission ...' (* No user access *)
## sleep 2 { Let the user read it }
## message 'See the DBA for help'
             /* Only the DBA can help */
You cannot mix delimiters: a comment starting with /* must end with */ and not with *) or }.
Other EQUEL language preprocessors use braces ({ and }) as EQUEL block delimiters in statements such as retrieve and unloadtable. If you are converting EQUEL statements from another language into Pascal, be sure to change those block delimiters to the EQUEL/Pascal block delimiters, begin and end, so that the preprocessor does not treat them as Pascal comment delimiters.
Last modified date: 11/28/2023