<doc>
	<legacy_id>1219</legacy_id>
	<name>recursionLimit</name>
	<type>property</type>

	<syntax>
		<example>set the recursionLimit to stackSizeInBytes</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Specifies how many levels deep a recursive function is allowed to go.</summary>

	<examples>
<example>set the recursionLimit to 20</example>
	</examples>

	<history>
		<introduced version="2.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
		<global/>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Writing LiveCode</category>
	</classification>

	<references>
	</references>

	<description>
	<overview>Use the recursionLimit property to quickly find possible recursion bugs or to extend the ability to use deeply recursive routines.</overview>

		<parameters>
		</parameters>

	<value>The recursionLimit is a positive integer.<p>By default, the recursionLimit property is set to 400000.</p></value>
	<comments>The <i>stackSizeInBytes</i> specifies the CPU call stack size. ("Stack" in this sense has nothing to do with LiveCode stack objects; it refers to a type of data structure used by the processor.)<p></p><p>The relationship between the <b>recursionLimit</b> and the number of levels of nesting permitted for a recursive call depends on a number of factors, including the processor type and the number of parameters passed during each function call. This means that the same recursionLimit value may allow a different maximum level of nesting, depending on the platform.</p><p></p><p>Recursion may be used deliberately, especially in processing large data sets. To allow deeper levels of recursion than usual, increase the <b>recursionLimit</b>.</p><p></p><p>Recursion may also occur accidentally. In this case, the recursion is usually infinite--that is, the function will keep recursing until it reaches the limit and causes an execution error. To track down such problems more quickly, reduce the recursionLimit. The lower the limit, the more quickly a buggy routine will cause an execution error.</p><p></p><note>On Windows, as of version 4.5.1, the recursionLimit property is bounded by the stackLimit. Attempts to set the recursionLimit greater than the stackLimit will see it downwardly adjusted to the maximum current size allowed.</note></comments>
	</description>
</doc>