| |
nyonomay
Posts: 1
Score: 0
Joined: 3/6/2008
Status: offline
|
I am looping while both arrays are les than or equal to their ubound limits. I want to do a strComp and increment the i or j counters as below, depending on the outcome of the string. The problem is, when I run the program and feed it two arrays, the page either hangs and does nothing or I get an out of bounds error on i or j. I need this function to work when the arrays that are being passed to it are of different lengths. ANY help woul dbe wonderful, thanks in advance :) ----code--- function localTextMetric(tsortedTargetArray, sortedQueryArray) do while i <= ubound(sortedTargetArray) or j <= ubound(sortedQueryArray) if i<= ubound(sortedTargetArray) or j<= ubound(sortedQueryArray)then alpha = StrComp(sortedTargetArray(i), sortedQueryArray(j)) if alpha = -1 then i = i + 1 elseif alpha = 1 then j = j + 1 elseif alpha = 0 then i = i + 1 j = j + 1 intersection = intersection + 1 end if end if loop response.write(i) response.write(j) response.write(intersection) end function
|
|