UBOUND
<% if UBOUND(Arr) > 0 then%>
<% end if %>
I am getting the following error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'UBOUND'
How do I solve the problem.
<% if UBOUND(Arr) > 0 then%>
<% end if %>
I am getting the following error:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'UBOUND'
How do I solve the problem.
what role does ubound play here?like whats the diff between
--------
for j=0 to ubound(arrMsgid)
-------
and
--------
for j=0 to arrMsgid
-------
where arrMsgid is an array
I just got an odd result when I tried to split() a string that didn't have the delimitor in it...it looks like an array without any elements (which is weird - I've never seen one of those in VBS).
UBound says the upper bound on the array is -1, but isArray() says that it is indeed an array. Is there an easy way to check for this condition (or do I have to do both isArray AND UBound)? My VBS docs say nothing about split() returning an undefined array nor UBound() returning a -1. What the dilly, yo?
this code gives me one short of the ubound function, what is wrong?
e.g if i have 353425432,325423,2542354
it gives me 2 instead of 3
jumvar = request.QueryString("one")
jumvarsplt = split(jumvar,",")
valnum = CInt(ubound(jumvarsplt))
Error is:
Subscript out of range: '[number: 0]'
or
Subscript out of range: '[number: 1]'
or
Subscript out of range: '[number: 2]'
This is correct in that the variable is empty if user does not fill in correctly. However how do i stop it falling over and just get it to error handle?
e.g. If Subscript out of range: '[number: 2]' empty how do I 'know' this without an error? Code:
I am currently using arrays to store values that a user inputs into text fields which represent cells in an access table. I am currently coding them like this:
*********
HomeScore = Array(0,1,2,3,4,5,6,7)
HomeScore(0) = Request("Home_score1")
HomeScore(1) = Request("Home_score2")
HomeScore(2) = Request("Home_score3")
HomeScore(3) = Request("Home_score4")
HomeScore(4) = Request("Home_score5")
HomeScore(5) = Request("Home_score6")
HomeScore(6) = Request("Home_score7")
HomeScore(7) = Request("Home_score8")
*********
And then later refering to these values using a for loop like so:
*********
For x = 0 to 7
strsql = "Update CUPFirstRound Set Home_Score=(" & HomeScore(x) & "),...
conn.execute(strSQL)
Next
*********
I know that it is possible to shorten this cpodiong using the Ubound function but i really dont know how to use it and i cant find any where useful on the net that explains it how i need to know.
If anyone can help me from what they see above then it would be Really appreciated, if you need more code just let me know. I didnt paste the whole code because that is pretty pointless because its virtually all the same except for the names of the arrays and the fields it is requesting (Request("..."))
I got a problem while running an application. The code for this is as follows:
aList = Split(strMsg,";")
For nX = 0 to UBound(aList)
strarry=split(aList(nX),"_")
var_year=left(strarry(2),4)
var_month=mid(strarry(2),5,2)
var_day=mid(strarry(2),7,2)
var_date=var_day&"-"&var_month&"-"&var_year
var_time1=mid(strarry(2),9,2)
var_time2=mid(strarry(2),11,2)
var_time=var_time1&":"&var_time2
set rs1=conn.execute("insert into tbl_BackupfileInfo(Filename,Createddate,Createdtim e)values('" &aList(nX)&"','"&var_date&"','"&var_time&"')")
Next
while runnig this application some times it works fine .But some times it giving an error
Error Type:Microsoft VBScript runtime (0x800A000D) Type mismatch: 'UBound'.