Everything is in the title I guess.
You may specify an event name as parameter and trigger this event by name using the TriggerEvent function. But you can't specify parameters.
Or you specify an "callback" object that provide a public function (or event) that you may call from the function.
- Roland Smith
- Thursday, 2 April 2020 14:42 PM UTC
If Not gnv_app.IsLicenseActive Then
Would cause the 'getter' function to run which would be some code to determine if the program license is active.
I do this all the time in my frameworks and have for years (OK, decades - LOL)! As you have probably found in the function painter though, using another global function as an argument results in an error(s).
Sooooooo .... The trick here is to use an NVUO as a function-to-function broker.
Function #1 => NVUO => Function #2 => NVUO => Function #3 => NVUO => Function #NN
Here is a real simple example: my simple test code of F#1 => NVUO = F#2. Where F1 sets the calling parameter to 2 and F#2 computes its argument from F#1 to return argument * 100.
Test Call: MessageBox ("Func-2-func Test" , String ( fn_one ( 2 ) ) )
lo_broker = CREATE nc_broker
li_num = lo_broker.of_func2 (ai_num )
li_num = fn_two ( ai_number )
li_num = ai_num * 100
Using this approach, even F1 could call a succession of functions F2,F3,F4 etc in a row using the NVUO as the function to function broker. In fact, what have here is an MVC design - just like we see in PB2019's new "C# Web API". Add in recursion, and the NVUO can even broker into itself to call a slew of other GF's in one thread. OK, maybe that's a bit too much for the synapse connections for the moment (working on 5 cups plus of coffee now ... whee).
On yeah .. the test result ...
Now with a little more "creative" design and programming, you can make the NVUO "broker" handle "dynamic" routing to any other GF(s) on-the-fly vs my hard coded example above. ;-)
Food for thought.
Regards ... Chris
- Page :
However, you are not allowed to reply to this question.