我可以在 Netlogo 中使用 try catch(异常处理)吗
Can I use try catch (Exception Handling) in Netlogo
如何在 NetLogo 中使用异常处理?如果我有错误,它会显示 运行-time 错误。我不想显示此错误,而是想在 运行 时间捕获它并改为执行其他操作(例如在 c# 或 vb.net 中)。任何帮助将不胜感激。谢谢
carefully
primitive does exactly that, and the error message is available using error-message
:
carefully [
print mean [] ; try to take the mean of an empty list
] [
print error-message ; or do something else instead...
]
如何在 NetLogo 中使用异常处理?如果我有错误,它会显示 运行-time 错误。我不想显示此错误,而是想在 运行 时间捕获它并改为执行其他操作(例如在 c# 或 vb.net 中)。任何帮助将不胜感激。谢谢
carefully
primitive does exactly that, and the error message is available using error-message
:
carefully [
print mean [] ; try to take the mean of an empty list
] [
print error-message ; or do something else instead...
]