1 頁 (共 1 頁)

[ASP]如何判斷物件是否set nothing

發表於 : 2008年 11月 26日, 18:10
tim
在 asp 中, 使用 VBScript 語法, 釋放物件資源時, 會用到判定是否 object reference 已為 nothing, 判斷上可以用兩種方式實現:

1. obj Is Nothing
2. TypeName(obj) = "Nothing" '注意大小寫有分

其中第1項是利用了 Is operator 來判定, 比較直覺, 而用 TypeName 也是很有趣的用法, 給在找判定 Set Nothing 的朋友們一個參考.

參考資料:
http://evolt.org/node/346