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: Sub Dialogs - Setting Variables  (Read 10512 times)
Dave T.
Posts: 4


« 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



* main_dialog.4gl (0.97 KB - downloaded 977 times.)
* sub_dialog.4gl (0.28 KB - downloaded 968 times.)
* sub_dialog_a.per (0.48 KB - downloaded 968 times.)
Reuben B.
Four Js
Posts: 1126


« Reply #1 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

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Dave T.
Posts: 4


« Reply #2 on: December 24, 2013, 04:08:04 am »

That's awesome, it keeps getting better :-)

Thanks
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines