User:Patrick/Transclusion depth test

Transclusion depth test:

This template is used in the investigation of template depth limits.

It calls subtemplate /39, which produces row 0 and calls /38 which produces row 1 and calls /37, etc.

The examples show that the complexity of the expression for parameter 1 does not make any difference for the number of levels of subtemplates without error. Also, putting the call in the then- or else-part of #if does not make a difference. However, putting the call in a template parameter reduces the number of levels of subtemplates without error by 1.

Maximum depth
To limit the maximum depth of the test, set  to a value between 0 and 40.

The default value for maxdepth is 40.