如何检查 Caché 对象脚本中是否存在变量?

How to check that variable exists in Caché Object Script?

在 COS 中有没有更优雅的方法来检查是否设置了变量?

我能猜到的棘手的是下一个:

set test = ""
write $get(test, "NO") '= "NO"

但是 test 变量也可以等于 "NO"...

您可以使用 $Data(var)Documentation.