亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在asp中類型不匹配: 'UBound' 這是為什么呢?

在asp中類型不匹配: 'UBound' 這是為什么呢?

aluckdog 2022-04-01 11:07:38
報錯內容是: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 回答

?
慕容森

TA貢獻1853條經驗 獲得超18個贊

比如你定義變量int num;這個num是整型,而你卻要給這個num賦值num="a";這樣就會報錯,因為a不屬于整型,無法進行加減運算等。
你這個應該是哪個變量的類型是UBound,而你將它賦值為其它類型或是與其它類型比較。
相當于問你a和1哪個大,a是字母,1是數字,兩個是不能進行比較的,也就是類型不一樣。

查看完整回答
反對 回復 2022-04-07
?
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

查看完整回答
反對 回復 2022-04-07
  • 2 回答
  • 0 關注
  • 408 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號