September 13, 201015 yr Hi all friends did you know that you can have recursions w/o CFs and scripts ? Loop_into__the_field.zip
September 13, 201015 yr Author It seems that the max recursion's number is: 356. So, if the calc is: Let( $i = $i + 1 ; [color:red]$i ^ 5 & If ( $i < EndLoop ; ¶ & Test ; Let( $i = "" ; "" ) ) ) you'll have all the values till 356^5 = 5,718,076,875,776 Another limitation is that it works only into unstored calculations. ( So I think that an UNSTORED calculation works by using its field name, not to keep its content, but to [color:green]evaluate its own calculation )
September 14, 201015 yr It seems that the max recursion's number is: 356. So, if the calc is: Let( $i = $i + 1 ; [color:red]$i ^ 5 & If ( $i < EndLoop ; ¶ & Test ; Let( $i = "" ; "" ) ) ) you'll have all the values till 356^5 = 5,718,076,875,776 Another limitation is that it works only into unstored calculations. ( So I think that an UNSTORED calculation works by using its field name, not to keep its content, but to [color:green]evaluate its own calculation ) Can you please explain the underlined element?
September 14, 201015 yr Author If you try my file ( attached to the first post ), you'll see that EndLoop is a field where you can enter the number of recursions.
September 14, 201015 yr The 356 limit is limiting, but it's a nice feature for those who don't have Advanced. Otherwise, I don't see why you wouldn't use a custom function.
September 14, 201015 yr Author D J Yes it is interesting to know but I can't find a real use for it, neither for those that haven't Advanced ( they still have ScriptMaker ). The more interesting thing that I learn from it is the way FileMaker handles unstored calculation fields.
November 2, 201015 yr Hi daniele, I just looked at this file do to the current thread Here and I'm wondering what the purpose of the calculation is. If it is to make a list of the alphabet that includes each letter up to the number in the EndLoop, then why does it skip the letter "i", or have I missed something again? Lee
November 2, 201015 yr Author Hi Lee this is the string that I used in that example: "abcdefghkjilmnopqrstuvwxyz" ( i at 11th position ) but had to be: "abcdefghijklmnopqrstuvwxyz" ( i at 9th position )
June 1, 201114 yr Author from another thread: For anyone reading this thread, you included, I'd recommend against forcing recursion by referencing a calculation field to itself. Although it might seem to work in some circumstances, it's not possible to predict how it will behave under other conditions. Unlike a custom function, there is no built-in protection against stack overflow and you might easily end up with the application crashing and your file being corrupted. Hi comment I wish to go more inside this subject, expecially the ipothetic corruption. My tests didn't give any crash, even if I do not trap for recursion's number.
June 1, 201114 yr My tests didn't give any crash That doesn't mean it won't crash in other tests. I'm not saying it will, but it's not possible to prove it won't. The only conclusive test possible is one that does crash - but I am not going to try that.
June 1, 201114 yr Author I do not think it is right to argue that a certain calculation will fail and will have dire consequences, but without having the evidence. BTW: At least one advantage: allows you to directly test a future custom function
June 1, 201114 yr Let me try and make this as clear as I can: The "Technical specifications of FileMaker Pro 11 and FileMaker Pro 11 Advanced" state: Recursion limit for custom function: 1. 50,000 recursive calls total 2. The call stack is only allowed to be 10,000 calls deep at any point. If these limits are violated, the custom function will return "?". The specifications do not mention a limit for a calculation field calling itself - so either there is no such limit, or circular reference is not supported. Draw your own conclusion and proceed at your own risk.
Create an account or sign in to comment