Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Benjamin G. on April 04, 2022, 09:11:43 pm



Title: Maybe a little bug (fglcomp 4.00.03 rev-82223658)
Post by: Benjamin G. on April 04, 2022, 09:11:43 pm
Hi,

MAIN
  define i smallint = NULL
  define s string

  let s = 'i = ' || Nvl(i,0) USING '<<&'             # concatened with ||
  display s                                ------>            RESULT = "0"


  let s = 'i = ',Nvl(i,0) USING '<<&'                  # concatened with ,
  display s                                                       RESULT = 'i = 0'

END MAIN

Regards


Title: Re: Maybe a little bug (fglcomp 4.00.03 rev-82223658)
Post by: Sebastien F. on April 04, 2022, 09:21:19 pm
Hello Benjamin,

The || operator has a higher precedence as USING

Try with parenthesis:

Code
  1.     LET s = 'i = ' || (NVL(i,0) USING '<<&')

See:

https://4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#fgl-topics/c_fgl_operators_CONCATENATE.html

https://4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#fgl-topics/c_fgl_operators_014.html

Seb


Title: Re: Maybe a little bug (fglcomp 4.00.03 rev-82223658)
Post by: Benjamin G. on April 04, 2022, 09:27:00 pm
Hi,

Yes indeed, the documentation is clear

Sorry