Split函数出错了,请大虾们解释解释

kele2005 2005-12-31 10:19:29
字符串:str="22-0-21-1-20-1-19-1"
第六十行:theSplit = Split(str,"-")

出错信息:
Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配

.....my.asp,行60
...全文
223 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
kele2005 2006-01-13
  • 打赏
  • 举报
回复
xxuu503(学会糜烂和挥霍,恐惧不安和堕落!) 说的对!!!定义的时候不要()就可以了
简若的学习窝 2006-01-12
  • 打赏
  • 举报
回复
如果只是看字面意思肯定没有错,而应该是你的str没有传回值,也许你的STR中什么值也没有。
jspadmin 2006-01-11
  • 打赏
  • 举报
回复
呵呵,所以楼主以后要先多思考下再发帖啦,不都自己解决了嘛
eduxh 2006-01-11
  • 打赏
  • 举报
回复
哪错了??
tigerwen01 2006-01-11
  • 打赏
  • 举报
回复
不是第六十行:theSplit = Split(str,"-")出错
kele2005 2006-01-11
  • 打赏
  • 举报
回复
没人进来,就没法结贴呀,好歹回复一下
xxuu503 2006-01-11
  • 打赏
  • 举报
回复
dim theSplit() 不要括号就对了
junny1983 2006-01-11
  • 打赏
  • 举报
回复

<%
option explicit
dim str,thesplit,i
str="22-0-21-1-20-1-19-1"
theSplit = Split(str,"-")
for i=0 to ubound(thesplit)
response.write thesplit(i) & "<br>"
next
%>

在我这里运行通过,没有问题
yelanne 2006-01-11
  • 打赏
  • 举报
回复
theSplit(10) = Split(str,"-")
tempzzz 2006-01-11
  • 打赏
  • 举报
回复
dim theSplit() 去掉就好了
wxf0104 2006-01-11
  • 打赏
  • 举报
回复
哪儿错了呀?
wen1818 2006-01-11
  • 打赏
  • 举报
回复
类型不匹配 说明str格式问题
所以可以判断出str为NULL

在split之前,判断一下
if str<>"" or isempty(str) then
theSplit = Split(str,"-")
end if
sandsboy 2006-01-11
  • 打赏
  • 举报
回复
str="22-0-21-1-20-1-19-1"
arr = Split(str,"-")
for i = lbound(arr) to ubound(arr)
...
next
bigluckyfox 2006-01-11
  • 打赏
  • 举报
回复
theSplit() = Split(str,"-")后,

得给数组一个下标范围
KimSoft 2006-01-11
  • 打赏
  • 举报
回复
不是theSplit = Split(str,"-")这个错误吧。
I2K 2006-01-11
  • 打赏
  • 举报
回复
>>下标越界: 'theSplit'

应该是读了空值。
kele2005 2006-01-10
  • 打赏
  • 举报
回复
我知道那错了
kele2005 2005-12-31
  • 打赏
  • 举报
回复
dim theSplit()
...........................
当我将theSplit = Split(str,"-")改为
theSplit() = Split(str,"-")后,
出错信息:
Microsoft VBScript 运行时错误 错误 '800a0009'

下标越界: 'theSplit'

/sysmanage/image.asp,行61

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧