--# BDS comment in Genero

Started by Stephen T., September 05, 2013, 02:51:15 PM

Previous topic - Next topic

Stephen T.

It seems that in BDS you could have  a comment marked with --# that effectively was a copiler directive to ignore that line in certain circumstances.
It also seems that this is in the Genero compiler (ie --# lines are NOT treated as comments) - is this a permanent feature to be compatible with BDS - so is presumably staying around for a while?

Is it documented anywhere? I searched the FGL doc buty only came up with references to SQL.

Rene S.

This is a permanent feature. This feature exists since the first versions of BDL/Genero.
BTW: See this example. This example inverts the feature. The Informix compiler can see the lines between "--#{" and "--#}" as code. The Genero compiler sees the same lines as comment.

Code (genero) Select

DEFINE a1, a2 DYNAMIC ARRAY OF INT
--#{
    allocate ARRAY a1[10] -- not visible for Genero, visible for i4gl
--#}



Scott B.

The --# is in the 4.2 documentation at this location:

https://4js.com/online_documentation/fjs-fgl-manual-html/User/LanguageFeatures.html#LF_COMMENTS

For the upcoming release, the Comments topic has been augmented to be more precise:

The symbol that immediately follows the -- comment indicator must not be the sharp (#) symbol, unless you intend to compile the same source file with the Informix® 4GL product. The --# specific comment indicator can be used to distinguish Informix 4GL from Genero BDL code. This conditional code compilation technique can be inverted by enclosing code blocks between --#{ and --#} comments:
Code (genero) Select
MAIN
  --# DISPLAY "Ignored by I4GL, but compiled with BDL."
  --#{
      DISPLAY "Ignored by BDL, but compiled with I4GL."
  --#}
END MAIN