我想知道是否可以在调试模式下运行特定代码。
例如像这样:
if DEBUG
print "Hello World"
如果我处于调试模式,它只会打印"Hello World",但是当我处于发布模式时,它应该被编译掉。这可能吗?
你可以为此使用编译器指令
#if DEBUG
printfn "Hello World"
#endif