如何判断自定义的structure为空啊
我有一个自定义的structure如下:
Public Structure TeiDenKouZi
Public Chg_Flg As String
Public TT_NO As String
Public TDBN_NO As String
End Structure
我在使用它时是这样写的
dim clsTei as new TeiDenKouZi
请问这时如何判断我自定义的这个Structure是否为空啊
[解决办法]
没办法,写个成员方法
Public Structure TeiDenKouZi
Public Chg_Flg As String
Public TT_NO As String
Public TDBN_NO As String
public property IsEmpty as Booleen
get
return Chg_Flg is Nothing and TT_NO is nothing and TDBN_NO is nothing
end get
end property
End Structure
[解决办法]
这个重新实例化了就是没有值的
就好像 dim dt as new dataTable
你给dt附个数据源
再用的时候直接
dt = new Datatable()
就空了啊
不过说说我的方法把
我一般喜欢写一个方法类似一些系统函数的clear
Public Structure TeiDenKouZi
Public Chg_Flg As String
Public TT_NO As String
Public TDBN_NO As String
public sub Clear()
Chg_Flg =nothing
TT_NO =nothing
TDBN_NO =nothing
end property
End Structure
不知道,是不是答非所问了....