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?
6 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.
-
I had forgotten about this, but just noticed it again.
I still don't see that the problem I experienced can possibly be explained by what said above.
Let say there are 100 Global Functions, that all work perfectly. One more is added that is unrelated to any other, is dependent on NOTHING else (just concatenates some text) and that 101st function just will not work. All the other 100 still work perfectly.
Add another (102nd) function, similarly unrelated to and not dependent on anything and also maybe just some simple text stuff (no fields, no formula, no referenced functions) and this one does not work, but the 101st function now DOES work.
Repeat ad infinitum (ok, I didn't test that many) and always the last function will not work, but all the others do.
I just do not see this can have anything to do with any obscure circular references since there are NO such references in the functions that do not work.
To me it looks like an obscure Ninox bug that above a certain number of global functions, it is unable to actually use the last one.
Content aside
-
1
Likes
- 6 days agoLast active
- 6Replies
- 151Views
-
4
Following
