strARR1 = "5,10,15,20,25,30"

1. Senior Member
Join Date
Dec 1969
Posts
181

## strARR1 = "5,10,15,20,25,30"

Hi i got a problem <BR>when i post the number (5,10) <BR>are found . <BR>And i want to count them in a variable "(2) numbers where found" <BR><BR>How do i do that? <BR><BR>strARR1 = "5,10,15,20,25,30" <BR>strARR2 = "5,6,7,8,9,10" <BR><BR>Dim ARR1, ARR2 <BR><BR><BR><BR>&#039;------------------------------------------------------------------ <BR>&#039;these two lines output lists for user to see during comparisons <BR>&#039;------------------------------------------------------------------ <BR>response.Write("ARR1= (" & strARR1 & ") <BR>") <BR>response.Write("ARR2= (" & strARR2 & ") <BR>") <BR><BR><BR>&#039;------------------------------------------------------------------ <BR>&#039;Convert lists into arrays <BR>&#039;------------------------------------------------------------------ <BR>ARR1 = split(strARR1,",") <BR>ARR2 = split(strARR2,",") <BR>&#039;------------------------------------------------------------------ <BR>&#039;Compare arrays and find values common to both <BR>&#039;------------------------------------------------------------------ <BR>If request("buttonchoice") = "common" then <BR> strOutput = "(" <BR> for i = 0 to ubound(ARR1) <BR> for j = 0 to ubound(ARR2) <BR> <BR> if ARR1(i)=ARR2(j) then strOutput=strOutput & ARR1(i) & "," <BR> next <BR><BR> next <BR><BR> strOutput = Left(strOutput, Len(strOutput)-1) <BR> strOutput = strOutput & ")" <BR><BR>end if

2. nji
Member
Join Date
Dec 1969
Posts
57

## RE: strARR1 =

strARR1 = "5,10,15,20,25,30" <BR>strARR2 = "5,6,7,8,9,10" <BR><BR>aARR1 = Split(strARR1,",")<BR>aARR2 = Split(strARR2,",")<BR>for i=0 to UBound(aARR2)<BR> if UBound(Filter(aARR1,aARR2(i)))&#062;-1 then<BR> strOutput=strOutput & aARR2(i)<BR> if i&#060;UBound(aARR2) then strOutput=strOutput & ","<BR> end if<BR>Next<BR>response.write strOutput

#### Posting Permissions

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