退出 Nim 中的控制台应用程序

Duc*_*ett 1 nim-lang

我想知道如何退出 Nim 中的控制台应用程序。

dot*_*ixb 5

您可以使用系统模块中的退出功能,例如

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 上阅读有关详细 qu​​it函数或简写 quit函数的更多信息