Difference between revisions of "Error Messages/41036"

 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Error message =
+
[[Category: Error messages]]
  
Recursive or cyclic dependency -- the definition of F depends directly or indirectly on itself.
+
== Error message ==
    F - G - H - F
+
 
If you intend for F to be recursive, check the checkbox.  Do you want to edit the Definition of F?
+
Example: Recursive or cyclic dependency. The definition of function Factorial2 depends directly or indirectly on itself.
[ ] Mark F as recursive
 
[Yes] [No]
 
 
   
 
   
+
::[[File:Error message about recursion.png]]
= Description =
+
 
 +
== Cause ==
 +
 
 +
When you define a [[User-Defined Function]] that depends on itself, either directly, because its Definition mentions itself, or indirectly through a series of function calls, you create a recursive or cyclic dependency.  Unless you did this intentionally in order to implement a [[Recursion|recursive function]],  you probably made a mistake. This message can assist you in finding where the mistake lies.  The sequence of functions listed on the second line shows you how the dependency arises. 
  
When you define a [[User-Defined Function]] that depends on itself, either directly or indirectly through multiple function calls, you create a recursive or cyclic dependency.  Unless you did this intentionally in order to implement a recursive function, this indicates you probably made a mistake, and this message about the cyclic dependency can assist you in finding where the mistake liesThe sequence of functions listed on the second line shows you how the dependency arises.  In the example, We can see that function F calls function H, which calls function G which calls function F, creating the dependence of F on itself.
+
==Remedies==
 +
If you intended to create a recursive function, then  just check the checkbox in the error dialogThis will set the Recursive attribute for the function, so it will accept a recursive definition without error.
  
If you really do intend to create a recursive function, then you should just check the checkbox.  This will set the Recursive attribute for the function to 1, which then accepts a recursive definition without reporting an error.
+
If you created the cyclic dependency by mistake, edit the function definition to correct it.
  
<comments />
+
==See Also==
 +
* [[Function calls and parameters]]
 +
* [[User-Defined Function]]
 +
* [[Recursion]]
 +
* [[Definition]]
 +
* [[Expression Syntax]]
 +
* [[Expression Assist]]

Latest revision as of 21:55, 25 October 2024


Error message

Example: Recursive or cyclic dependency. The definition of function Factorial2 depends directly or indirectly on itself.

Error message about recursion.png

Cause

When you define a User-Defined Function that depends on itself, either directly, because its Definition mentions itself, or indirectly through a series of function calls, you create a recursive or cyclic dependency. Unless you did this intentionally in order to implement a recursive function, you probably made a mistake. This message can assist you in finding where the mistake lies. The sequence of functions listed on the second line shows you how the dependency arises.

Remedies

If you intended to create a recursive function, then just check the checkbox in the error dialog. This will set the Recursive attribute for the function, so it will accept a recursive definition without error.

If you created the cyclic dependency by mistake, edit the function definition to correct it.

See Also

Comments


You are not allowed to post comments.