报错内容是:Microsoft VBScript 运行时错误 错误 '800a000d'类型不匹配: 'UBound'/incs/config.asp,行 1197config.asp第1197行的内容是:for tempc=0 to ubound(tempvar)以下是部分内容:function getwebnav(byval pdttpe,byval pcid)if not chk_int(pcid) thenpcid=SafeRequest("pcid")end iftempvar=application("pl_menu_"&pdttpe)for tempc=0 to ubound(tempvar)tempv=tempvar(tempc)if instr(tempv,":") thentemppcid=getvalsec(tempv,":",1)if not chk_int(pcid) thenpdtclsnme=getvalsec(tempv,":",2)pcid=temppcidexit forelseif cint(pcid)=cint(temppcid) thenpdtclsnme=getvalsec(tempv,":",2)exit forend ifend ifnextsession("pdtclsnme")=pdtclsnmesession("pcid")=pcidtempvs=application("pl_menutpe")for myi=0 to ubound(tempvs)tempv=tempvs(myi)if lcase(left(tempv,3))=lcase(pdttpe) thentempp=right(tempv,len(tempv)-instr(tempv,":"))tempp=left(tempp,instr(tempp,":")-1)session("pdttpenme")=temppend ifnextend function
2 回答
![?](http://img1.sycdn.imooc.com/545865620001c45402760276-100-100.jpg)
慕容森
TA贡献1853条经验 获得超18个赞
比如你定义变量int num;这个num是整型,而你却要给这个num赋值num="a";这样就会报错,因为a不属于整型,无法进行加减运算等。
你这个应该是哪个变量的类型是UBound,而你将它赋值为其它类型或是与其它类型比较。
相当于问你a和1哪个大,a是字母,1是数字,两个是不能进行比较的,也就是类型不一样。
![?](http://img1.sycdn.imooc.com/54584f850001c0bc02200220-100-100.jpg)
12345678_0001
TA贡献1802条经验 获得超5个赞
在这句for tempc=0 to ubound(tempvar)之前要先用 Split将tempvar进行分割后才能用ubound来计算数组大小
例:
tempvar="a,b,c"
tempvar=Split(tempvar,",")
for tempc=0 to ubound(tempvar)
Response.Write tempvar(tempc)
next
添加回答
举报
0/150
提交
取消