Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Dave T. on December 24, 2013, 02:29:23 am



Title: Sub Dialogs - Setting Variables
Post by: Dave T. on December 24, 2013, 02:29:23 am
Hi,

I've been playing with the new Sub Dialog feature of 2.50 and trying to work out the best way to return variables that are entered in an external sub dialog.

In the example attached the dialog 'subdialog.dialog3' is called to input 'field3', now there is no way that I can find to return a variable (ie like in a call to a function). One way I though of in the 'after input' of the subdialog call the function 'setField3' passing the variable which is then assign to the modular record.

Am I missing something or is there a smarter way to do this ?

Cheers

Dave




Title: Re: Sub Dialogs - Setting Variables
Post by: Reuben B. on December 24, 2013, 03:17:48 am
Hi Dave,

In your sub-dialog, define a modular variable and make it PUBLIC so that it is visible outside the 4gl, and use that variable in your 4gl statement e.g.

Code
  1. PUBLIC DEFINE field3 CHAR(10)
  2. ...
  3. INPUT BY NAME field3


As it is public you can reference that variable from your main-dialog.4gl

Code
  1. IMPORT FGL sub_dialog
  2. ...
  3. LET m_inputRecord.field3 = sub_dialog.field3

Reuben


Title: Re: Sub Dialogs - Setting Variables
Post by: Dave T. on December 24, 2013, 04:08:04 am
That's awesome, it keeps getting better :-)

Thanks