如何判断olevar变量值是否为空??(100分)

H

hu_jun

Unregistered / Unconfirmed
GUEST, unregistred user!
下列代码
AnsiString type = xmlnode->ChildNodes->Nodes->Attributes[WideString("Value")]
提示“Could not convert variant of type (Null) into type (String)“
原因是因为xmlnode->ChildNodes->Nodes->Attributes[WideString("Value")]返回的
值是空,如何写强制转换的函数?
 
olevar is null
 
xmlnode->ChildNodes->Nodes->Attributes[WideString("Value")]
返回的值放在olevariant中,如何判断是否为空?

thanks for dz2050. is null 用于SQL
 
(olevariant=nil) or (olevariant=null)
 
在BCB中
if ( xmlnode->ChildNodes->Nodes->Attributes[WideString("Value")] != NULL )
好像不起作用,判断不了是否为空。why?
 
function VarIsNull;
 
Try this
if ( xmlnode->ChildNodes->Nodes->Attributes[WideString("Value")] != UnAssigned )
 
顶部