2. Embedded QUEL for C : Precompiling, Compiling, and Linking an EQUEL Program : Coding Requirements for Writing EQUEL Programs : Embedding Statements Inside C If Blocks
 
Share this page                  
Embedding Statements Inside C If Blocks
As mentioned above, the preprocessor may produce several C statements for a single EQUEL statement. However, all the statements generated by the preprocessor are delimited by left and right braces, composing a C block. Thus the statement:
if   (!dba)
##   retrieve (passwd = s.#passwd)
##   where s.username = userid
produces legal C code, even though the QUEL retrieve statement produces more than one C statement. However, two or more EQUEL statements generate multiple C blocks, so you must delimit them yourself, just as you would delimit two C statements in a single if block. For example:
if   (!dba)
     {
##   message "Confirming your user id"
##   retrieve (passwd = security.#passwd)
##   where security.usrname = userid
     }
VMS: Because the preprocessor generates a C block for every EQUEL statement, the VAX C compiler can generate the error "Internal Table Overflow" when a single procedure has a very large number of EQUEL statements and local variables. You can correct this problem by splitting the file or procedure into smaller components.