KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using the * parameter with the DIALOG command (v15 R5 and beyond)
PRODUCT: 4D | VERSION: 15 R5 | PLATFORM: Mac & Win
Published On: October 28, 2016

Tech Tip Using the * parameter with the DIALOG command gave example and detail on how to open a second dialog within the same process using the "*" parameter. What is detailed is some of the code gymnastics that have to be used to make effective and seamless use of the additional windows that can be opened in the same process.

The code reqired to accomplish the same tasks documented in the referenced Tech Tip is significantly simplified in 4D v15 R5 and beyond. This Tech Tip highlights how simple it is to accomplish the same functionality using the new command CALL FORM.

The windows below are used to illustrate the points that need special attention.


   


The "Clear List" button has been added to demonstrate how easy the CALL FORM command makes it to add functionality.

The code below opens the external window and is unchanged from the previous Tech Tip.

The form method for the external window has been significantly simplified. Note that code to clear the list box has been removed and the need for any code in the On Outside Call form event is no longer necessary.


The three images below shows the code in the second, third and fourth buttons and just how simple it is in v15 R5 to commnunicate with an external window.





The image below show the code contained in the project method MsgExtWin.

Though called from the context of the base window, the code runs in the context of the external window. Hence, there is no need for any code to force a redraw of the list box.

The first parameter contains the window ref of the external window. What this allows is the easy address of multiple external windows. In fact, the same project method can be called regardless of which of multiple open external windows there are and the code will be executed in the context of the referenced window.


The image below shows the contents of the list box after multiple clicks of the message button.