Rem 將字符串轉換為整形數據 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