Global NONfunctionality
Creating a new database and added 4 global functions which all work as they should, but then added a fifth function which simply doesn't work.
The function just has 2 'text' parameters which it munges together in the way I want and there is no error shown on the global functions page, but when trying to use the function in a script, I get the error that it doesn't exist, despite prompting me with the function name when I first start typing it.
I changed the name, what the function does, parameter types and everything I could think of, but same problem. Everything looks correct, the other GFs work, but not this last one.
I then added another function to test and no matter what I did, it will not work. But…
The previous one that first had the error now works perfectly.
So, three things are now apparent:-
- That problem function was actually completely correct
- For some reason, GFs all work, except the last one, whatever it is.
- This was not a problem with only 4 functions. They all worked.
I have since quit Ninox and will check to see if that clears the problem, but has anyone else come across this bizarre behaviour?
3 replies
-
I’ve encountered this kind of issue several times before, and each time it was due to a global function calling a formula in a table, which in turn called another global function. It may seem trivial, but here is what actually happens:
Global functions are compiled simultaneously, meaning they are all processed at the same time, regardless of one another. This works fine as long as there are no dependencies between them. Here’s a detailed explanation:
1. Simultaneous Compilation of Global Functions
F1 and F2, defined in the global functions space, are compiled together. As long as they don’t interact, there is no issue.
2. Using a Formula in a Table
If F1 calls a formula located in a table, that formula must be compiled to be used.
• This formula, in turn, calls F2.
3. Induced Dependency and Compilation Problem
The compiler must compile the formula in order to compile F1. However, since the formula depends on F2, the compiler must also process F2 in this context.
• The problem arises because F2 is also a global function compiled simultaneously with F1.
• This dependency creates a chain where F1 depends on the formula and the formula depends on F2, resulting in a circular dependency.
In summary, even if F1 and F2 are compiled in parallel, the fact that F1 calls a formula that requires F2 creates a circular dependency. The compiler ends up being unable to determine the proper order for compilation, which results in an error.
Content aside
- 20 hrs agoLast active
- 3Replies
- 41Views
-
2
Following