手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP字符串转换为整形、双精度型、布尔
ASP字符串转换为整形、双精度型、布尔
摘要:Rem将字符串转换为整形数据functiontoInteger(str,num)str=trim(str)ifstr=""ornotisnu...

Rem将字符串转换为整形数据

functiontoInteger(str,num)

str=trim(str)

ifstr=""ornotisnumeric(str)then

toInteger=num

else

toInteger=clng(str)

endif

endfunction

Rem将字符串转换为双精度型数据

functiontoDouble(str)

str=trim(str)

ifstr=""ornotisnumeric(str)then

toDouble=0.0

else

toDouble=cdbl(str)

endif

endfunction

Rem将字符串转换为布尔数据

functiontoBoolean(str)

str=lcase(trim(str))

ifstr="true"orstr="t"then

toBoolean=true

elseifisnumeric(str)then

ifclng(str)<>0thentoBoolean=true

else

toBoolean=false

endif

endfunction

【ASP字符串转换为整形、双精度型、布尔】相关文章:

ASP获得上月、本月、下月的第一和最后一天

Wrance的图片系统目录直读版1.0

ASP 非法字符过滤函数

对文件的操作--建立移动删除文件夹

ASP如何获取真实IP地址

ASP上传图片功能的又一实现(OLE对象)

将ACCESS转化成SQL2000要注意的问题

asp 字符串连接数据库方法

获取字符中中文首字字符

ASP获取数据库表名、库名、字段名的方法

精品推荐
分类导航