markdown 如何退出递归

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何退出递归相关的知识,希望对你有一定的参考价值。

```
//JS
var isRelationalLoop = _this.isPrecedingCoseCodeLoop(coseCodePre, binIdPre);

this.isPrecedingCoseCodeLoop = function (coseCodePre, binIdPre) {
    var _this = this;
    var isRelationalLoop = false;
    for (var i = 0; i < _this.routeDataList.length; i++) {
        if (_this.routeDataList[i]._coseCode == coseCodePre && _this.routeDataList[i]._binId == binIdPre) {
            if (_this.routeDataList[i]._coseCodePre != "" && _this.routeDataList[i]._binIdPre != "") {
                if (_this.routeDataList[i]._coseCodePre == coseCodePre && _this.routeDataList[i]._binIdPre == binIdPre) {
                    isRelationalLoop = true;
                    break;
                }
                else {
                    isRelationalLoop = _this.isPrecedingCoseCodeLoop(_this.routeDataList[i]._coseCodePre, _this.routeDataList[i]._binIdPre);
                    break;
                }
            }
            else {
                isRelationalLoop = false;
                break;
            }
        }
    }
    return isRelationalLoop;
};

```

```
// C#
plan.IsPrecedingCoseCodeRight = SelectPrecedingCoseCode(temp.PrecedingCoseCode, temp.RouteId);

public int SelectPrecedingCoseCode(int? precedingCoseCode, int routeID)
{
    int isRelationalLoop = 0;
    foreach (var route in routeMasterList)
    {
        if (precedingCoseCode == route.route_id)
        {
            if (route.preceding_cose_code_route_id != null)
            {
                if (route.preceding_cose_code_route_id == routeID)
                {
                    isRelationalLoop = 2;
                    break;
                }
                else
                {
                    isRelationalLoop = SelectPrecedingCoseCode(route.preceding_cose_code_route_id, routeID);
                    break;
                }
            }
            else
            {
                isRelationalLoop = 0;
                break;
            }
        }
    }
    return isRelationalLoop;
}
```

以上是关于markdown 如何退出递归的主要内容,如果未能解决你的问题,请参考以下文章

markdown 奇怪的是“git没有干净地退出(退出代码1)”

递归CCF201703-3 Markdown

递归代码以退出代码 3221225477 退出

markdown 循环,递归,遍历和迭代

markdown 递归删除目录

markdown XQuery中递归的介绍