2
A
回答
4
还有就是要实现这一行为没有简单的方法,但也许下面的建议将帮助。
您可以通过定义属性myBreakProperty
获得像一个休息当你发现你需要打破
<for list="a,b,c,d,e" param="letter" keepgoing="true">
<sequential>
<if>
<equals arg1="@{letter}" arg2="c" />
<then>
<property name="myBreakProperty" value="nevermind the value"/>
</then>
</if>
<fail if="myBreakProperty"/>
<echo>Letter @{letter}</echo>
</sequential>
</for>
输出将是:Letter a Letter b
要获得类似于cont inue:
<for list="a,b,c,d,e" param="letter" keepgoing="true">
<sequential>
<if>
<equals arg1="@{letter}" arg2="c" />
<then>
<fail/>
</then>
</if>
<echo>Letter @{letter}</echo>
</sequential>
</for>
输出将是:Letter a Letter b Letter d Letter e
1
您可以休息一下流程,而无需运行苛刻的失败的东西。使用属性来检测你想要打破什么时候你可以实现这样的事情:
<var name="break.flag" unset="true"/>
<for list="a,b,c,d,e" param="letter">
<sequential>
<if>
<not>
<isset property="break.flag"/>
</not>
<then>
<if>
<equals arg1="@{letter}" arg2="c" />
<then>
<property name="break.flag" value="true"/>
</then>
</if>
<if>
<not>
<isset property="break.flag"/>
</not>
<then>
<echo>Letter @{letter}</echo>
<echo>Do the rest of the loop here</echo>
</then>
</if>
</then>
</if>
</sequential>
</for>
+0
你的代码不起作用,你需要取消设置标志,如果它击中 – sloven 2017-03-03 21:10:09
相关问题
- 1. 线程和中断:继续还是退出?
- 2. Java:如果加入线程无效:中断还是继续?
- 3. SIGALRM:在执行后继续执行
- 4. 如何在ios/xcode中声明c后继续执行或继续执行?
- 5. 继续执行异常
- 6. 击不继续执行
- 7. Lua继续执行脚本
- 8. 继续执行指令
- 9. Haskell:继续执行程序
- 10. 返回false继续执行
- 11. 继续执行程序
- 12. 继续执行DOM命令
- 13. 在python断言后如何继续执行程序?
- 14. 如果断言失败,请继续执行脚本
- 15. 如何让用户选择继续执行程序还是退出程序(C#)
- 16. 继续/跳出一个循环,继续执行
- 17. rdebug继续过去断点
- 18. 中断后在GHC中继续调试
- 19. 中断一个方法,但继续执行代码的剩余部分
- 20. bash继续执行命令失败
- 21. 在后台继续执行任务
- 22. 继续执行几项任务
- 23. Js脚本继续执行onchange
- 24. SocketServer在serve_forever后继续执行
- 25. 继续执行程序捕获异常
- 26. 一次性警报继续执行
- 27. 在PHP上继续执行SQL查询
- 28. jQuery - 继续之前执行功能
- 29. 无后退按钮执行继续?
- 30. 自动执行shell按Enter键继续
谢谢!这工作。 – 2013-04-08 19:34:55