'for'循环在它完成之前被杀死。 [英] 'for' loop being killed before it's finished.

查看:74
本文介绍了'for'循环在它完成之前被杀死。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在尝试构建树类型列表,其中列表中的每一行都有几个单元格(列)。我的代码将呈现第一个列表然后停止。第一个''for''语句应该转移到构建第二个列表,但循环被杀死。未显示列表,行和单元构造函数。


知道什么是杀死最初的迭代..是getChildren()中的递归吗?


感谢您的帮助!

Hi I''m trying to build tree type lists where each row in the list has several cells (columns). My code will render the first list ok then stops. The first ''for'' statement should be moving to build the second list, but the loop is killed. The ''list'', ''row'' and ''cell'' constructors are not shown.

Any idea what''s killing the initial iteration.. is it the recursion in getChildren()?

Thanks for you help!

展开 | 选择 < span class =codeDivider> | Wrap | 行号

推荐答案

嗨bugboy,

使用试试并捕获功能块。然后你就会知道bug的来源。或者你必须使用警报和chek。此外,在getChildren()中你没有使用return,因为函数是递归的()它会期待返回。


示例代码:

Hi bugboy,
Use try and catch block for the functions. Then you will know the source of the bug. Or you have to use alert and chek. Moreover in getChildren() you havent used return, since the function is a recursive() it will be expecting a return.

sample Code:

展开 | 选择 | Wrap | 行号


第10行的列表变量是全局的吗?我无法看到它在任何地方声明。
Is the list variable on line 10 a global? I can''t see it declared anywhere.


''list''''row''和''cell''都是对象,我没有展示他们的构造函数。


''getChildren''和''getCells''都写入文档中的目标元素,所以就我所知,不需要返回。
''list'' ''row'' and ''cell'' are all objects, i haven''t shown their constructors.

''getChildren'' and ''getCells'' both write to the target element in the document so a return isn''t needed as far as i know.


这篇关于'for'循环在它完成之前被杀死。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆