The user may accidently create a infinite loop (Column A calling Column B, and then Column B calling Column A)
The fields are probably currently propagated in a simple linear loop. (pretend its a 1 dimensional array instead of a 2d array.)
for(x=0; x<=datafield.length(); x++)
datafield.calculateBox[x];
If the user was allowed to call another column, they could end up nesting the first real data to draw from 20 or so columns deep.
Ex: Column 1 calls a variable in column 2, and the variable in column 2 calls a variable in column 3, then the variable in column 3 calls a variable in column 4..... .... which calls an actual number in column 20.
the way to fix get around this is to: (very rough p-code)
*test for infinite loops while the user is coding it
*turn the simple linear loop into something like this:
int BoxesCompleted=0;
int BoxesToComplete = datafield.length();
int Runs=0;
int MaxRuns=10;
Do
{
for(x=0; x<=datafield.length(); x++)
{
if ( the comparison is to a pre-establised or previously calculated figure) && (the box is not already calculated)
datafield.calculateBox[x];
BoxesCompleted++;
}
Runs++;
}
while(Runs<=MaxRuns && BoxesCompleted<BoxesToComplete);
// you guys could limit the number of runs to 2 if you so wanted, or you could make it nearly unlimited but warn the user how many runs it will take to complete and that it will slow down the program
You could do a recursive algorithm with a stack or que, which may be faster (but not by much), but this should be the simplest way to implement this new feature.
for reference sake here is the original issue:
Comment