Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Stephen T. on September 05, 2013, 02:51:15 pm



Title: --# BDS comment in Genero
Post by: Stephen T. on September 05, 2013, 02:51:15 pm
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.


Title: Re: --# BDS comment in Genero
Post by: Rene S. on September 06, 2013, 09:29:26 am
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
  1. DEFINE a1, a2 DYNAMIC ARRAY OF INT
  2. --#{
  3.    allocate ARRAY a1[10] -- not visible for Genero, visible for i4gl
  4. --#}
  5.  



Title: Re: --# BDS comment in Genero
Post by: Scott B. on September 06, 2013, 07:41:46 pm
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
  1. MAIN
  2.  --# DISPLAY "Ignored by I4GL, but compiled with BDL."
  3.  --#{
  4.      DISPLAY "Ignored by BDL, but compiled with I4GL."
  5.  --#}
  6. END MAIN