Comments
You can use the following characters in column 1 to indicate that a line is a comment:
• The letter "C"
• The asterisk (*)
• The lower case letter "c" (Windows)
• The exclamation point (!) (Windows)
The following example illustrates the correct use of the "C" comment delimiter:
exec sql select ename
1 into :namvar
2 from employee
C Confirm that "eno" is the same as the current
C value chosen
3 where eno = :curval
A comment line can appear anywhere in an Embedded SQL program that a blank line is allowed, with the following exceptions:
• In string constants. The preprocessor interprets such a comment as part of the string constant.
• Between component lines of Embedded SQL/FORMS block-type statements. All block-type statements (such as activate and unloadtable) are compound statements that include a statement section delimited by begin and end. Comment lines must not appear between the statement and its section. The preprocessor interprets such comments as Fortran host code, causing preprocessor syntax errors. For example, the following statement causes a syntax error on the first comment:
exec frs unloadtable empform
employee (:namvar = ename)
C Illegal comment before statement body.
exec frs begin
C Comment legal here
exec frs message :namvar
exec frs end
• An example of a compound statement is the display statement, which typically consists of the display clause, an initialize section, activate sections, and a finalize section. The preprocessor translates these comments as host code, which causes syntax errors on subsequent statement components.
• In parts of statements that are dynamically defined. For example, a comment in a string variable specifying a form name is interpreted as part of the form name.
The SQL comment delimiter (--) indicates that the remainder of the line is a comment. In-line comments are not propagated to the host language file.
Last modified date: 08/14/2024