Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Maybe a little bug (fglcomp 4.00.03 rev-82223658)  (Read 6856 times)
Benjamin G.
Posts: 130


« 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
Sebastien F.
Four Js
Posts: 545


« Reply #1 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
Benjamin G.
Posts: 130


« Reply #2 on: April 04, 2022, 09:27:00 pm »

Hi,

Yes indeed, the documentation is clear

Sorry

Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines