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: SUBDIALOG WITH PARAMETERS  (Read 243 times)
Benjamin G.
Posts: 135


« on: April 30, 2025, 11:24:53 am »

Hi,

Why this code doesn't compile (tested version 4.01 and 5.02) ?
Thank you

fglcomp 5.00.02 rev-025d702c
Genero 4gl compiler
Target l64xl228

Four Js*
Licensed Materials - Property of Four Js
(c) Copyright Four Js 1995, 2024. All Rights Reserved.
* Trademark of Four Js Development Tools Europe Ltd
  in the United States and elsewhere
root@vmgenerodev03:/tmp VMGENERODEV03      $fglcomp --verbose d
[parsing d.4gl]
[parsing d cancelled: 1 errors]
The compilation was not successful.  Errors found: 1.
The file 'd.err' has been written.
root@vmgenerodev03:/tmp VMGENERODEV03      $cat d.err
PUBLIC TYPE t_donations DYNAMIC ARRAY OF RECORD
  p_date  DATE,
  p_amount MONEY,
  p_reason VARCHAR(250)
END RECORD

DIALOG donations(donations t_donations INOUT)
| A grammatical error has been found at 'donations' expecting: ')'.
| See error number -6609.
    INPUT ARRAY donations FROM donations.*
      AFTER FIELD p_amount
        IF donations[arr_curr()].p_amount<2.0 THEN
          ERROR "must be at least 2 dollar:-)"
          NEXT FIELD CURRENT
        END IF
      AFTER ROW
        IF arr_curr()<=arr_count() THEN
          DISPLAY "AFTER ROW donations:check row and save to database"
        END IF
    END INPUT
END DIALOG


Sebastien F.
Four Js
Posts: 546


« Reply #1 on: April 30, 2025, 12:07:58 pm »

Hello Benjamin,

1) Still using de-supported FGL version 5.00 ? Please move to latest 5.01!

https://4js.com/download/products/?

2) Your t_donation type is a DYNAMIC ARRAY, which is implicitly passed by reference and does not need the INOUT keyword, reserved for RECORDs

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_runtime_stack.html

Try with FGL 5.01 compiler, you will get a better error message:

comment.4gl:14:5:14:24:error:(-8432) An INOUT parameter requires a RECORD type.

Seb
Benjamin G.
Posts: 135


« Reply #2 on: April 30, 2025, 04:08:25 pm »

Sorry, my fault not have seen that "Declarative dialogs support parameters (SUBDIALOG)" starting at 5.00.03

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/fgl_whatsnew_500v.html

Thank you
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines