array(sub script out of range error)

Results 1 to 2 of 2

Thread: array(sub script out of range error)

  1. #1
    Join Date
    Dec 1969

    Default array(sub script out of range error)

    Hi <BR>I am getting error subscrript out of range if I do like<BR><BR>please help <BR><BR>dim aColumValues, aValue,i,aValues<BR>aColumValues = objRecordset.GetRows(,, Array("fDateLeave"))<BR>Dim iRowLoop, iColLoop<BR>For iRowLoop = 0 to UBound(aColumValues,2)<BR>For iColLoop = 0 to UBound(aColumValues, 1)<BR><BR> aValue = (aColumValues(iColLoop,iRowLoop))<BR> <BR> Response.Write (aValue)<BR>Next<BR>Next<BR>I am getting the out put like this (12/03/0112/12/01/) <BR>but when i write the array like this working fine <BR>&#039;aColumValues=Array("9/12/01","12/22/01","12/22/01")<BR>Function isStringRepeat(aColumValues, sDate)<BR> Dim iUpper, iLoop,i<BR> i=0<BR> iUpper = UBound(aColumValues)<BR> For iLoop = LBound(aColumValues) to iUpper<BR> <BR> If CStr(aColumValues(iLoop)) = CStr(sDate) then<BR> i=i+1<BR> isStringRepeat = iLoop<BR> <BR> End If<BR> <BR> <BR>Next<BR>if (i&#062;1) then<BR>isStringRepeat = "yes"<BR>else<BR>isStringRepeat = ""<BR>end if<BR>End Function<BR><BR>Response.Write("the test"& isStringRepeat(aValues,sDate))

  2. #2
    Join Date
    Dec 1969

    Default WHERE is the error???

    I see nothing in that code that would cause an error!<BR><BR>The two chunks of code you show don&#039;t do ANYTHING AT ALL like the same code, so why are you comparing them???<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts