2. Embedded QUEL for C : EQUEL Statement Syntax for C : Comments
 
Share this page                  
Comments
Two kinds of comments can appear in an EQUEL program: EQUEL comments and host language comments. The /* and */ characters delimit EQUEL comments and must appear on lines beginning with the ## sign.
Because the EQUEL comment delimiters are the same as those for the C language, all comments appearing on EQUEL lines in a C program (those beginning with ##) are treated as EQUEL comments. Whereas the preprocessor passes C comments through as part of its output, it strips EQUEL comments out of the program and does not pass them through. Thus, source code comments that you desire in the preprocessor output should be entered as C comments—on lines other than EQUEL lines.
The following restrictions apply to any EQUEL or C comments in an EQUEL/C program:
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 details, see String Literals.
Comments cannot appear in string constants. If this occurs, the preprocessor interprets the intended comment as part of the string constant.
In general, you can put EQUEL comments in EQUEL statements wherever you can legally put a space. However, comments cannot 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 only to C comments in an EQUEL/C program:
C 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. C comment lines cannot 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 legal here */
      printf ("Employee name: %s", ename);
## }
C comments cannot appear between the components of compound statements. In particular, it is illegal for a C comment to appear between any two adjacent components of the display statement. This includes 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.
EQUEL comments are legal, however, in the locations the previous paragraph describes, 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 */
## {
      printf ("Employee name %s", ename);
## }