您可以使用系统模块中的退出功能,例如
quit(1) # where 1 is the error code
1.quit() # same as above
Run Code Online (Sandbox Code Playgroud)
或者
"Error message".quit(0) # where 0 is the error code
Run Code Online (Sandbox Code Playgroud)
在 nim doc 上阅读有关详细 quit函数或简写 quit函数的更多信息