Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possible to execute a sub function from another dialog?
#1
If I have 2 dialogs:

Dialog 1:
Has button a button labeled "start", button has id 7.

Dialog 2:
Has an editfield with text "123" in it.
And it has an subfunction "sub.displaytext" which outputs the contents of the inputfield of Dialog 2.
The moment Dialog 2 runs, I put it's dialog-ID in thread global variable:
Code:
Copy      Help
int- dlg2_id

Question:
Is it possible to execute "sub.displaytext" from Dialog 1 when button "start" is pressed?
The "sub.displaytext" only interacts with Dialog 2 and only outputs content of Dialog 2

So in the code of Dialog 1:

Code:
Copy      Help
...
case 7
   ...... code that executes "sub.displaytext" of Dialog 2
...

The help states
Quote:When you cannot use sub-function:
- The function is used by more than one macro/function/etc.
- ...

But I hope my case might be a bit different because the sub-function stays and executes within it's own
Dialog 2 scope. Dialog 1 only calls it and the sub-function only interacts with it's own Dialog 2.
#2
Both dialogs can be in single macro.
Code:
Copy      Help
Dialog1 code

#sub Dialog2

Dialog2 code

#sub displaytext

Also it's possible to use shared subfunctions, but in this case probably it is not a good idea.
#3
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)