Title: SUBDIALOG WITH PARAMETERS Post by: Benjamin G. 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 Title: Re: SUBDIALOG WITH PARAMETERS Post by: Sebastien F. 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 Title: Re: SUBDIALOG WITH PARAMETERS Post by: Benjamin G. 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 |