Jump to content
Server Maintenance This Week. ×

Getting more out of an $var: recursion without a CF or a script


This topic is 4723 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 )

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 6 months later...

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.