function tointeger(str,num)
str=trim(str)
if str="" or not isnumeric(str) then
tointeger=num
else
tointeger=clng(str)
end if
end function
rem 将字符串转换为双精度型数据
function todouble(str)
str=trim(str)
if str="" or not isnumeric(str) then
todouble=0.0
else
todouble=cdbl(str)
end if
end function
rem 将字符串转换为布尔数据
function toboolean(str)
str=lcase(trim(str))
if str="true" or str="t" then
toboolean=true
elseif isnumeric(str) then
if clng(str)<>0 then toboolean=true
else
toboolean=false
end if
end function
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!