arry string compare

There are 5 string fields. The string sets will be an arry i=0 to j.
My question is how can I get the most common string set?
Do I need to use two arrys to compare the 5 strings 0-j times?
Thank you for your help. I'm new here and don't have any idea.
whiteteaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
Can you show some code/example? What versions of VB are you using ?
0
whiteteaAuthor Commented:
Dim i as interger
Dim j as interger

string1 as string
string2 as string
string3 as string

            For i = 1 To j - 1
                With Results(i)
                    If String.IsNullOrEmpty(.String1.ToString) = False And _
                    String.IsNullOrEmpty(.String2.ToString) = False And _
                    String.IsNullOrEmpty(.String3.ToString) = False Then
                        Response.Write(.String1)
                        Response.Write(.String2)
                        Response.Write(.String3)
                    ElseIf String.IsNullOrEmpty(.String1.ToString) = False And _
                        String.IsNullOrEmpty(.String2.ToString) = False Then
                        Response.Write(.String1)
                        Response.Write(.String2)
                    ElseIf String.IsNullOrEmpty(.String1) = False And _
                        String.IsNullOrEmpty(.String3) = False Then
                        Response.Write(.String1)
                        Response.Write(.String3)
                    ElseIf String.IsNullOrEmpty(.String2) = False And _
                        String.IsNullOrEmpty(.String3) = False Then
                        Response.Write(.String2)
                        Response.Write(.String3)
                    Else
                    End If
                End With

            Next i
 
I get more than one result returned. This is wrong. I only want one string set return with most field fill in (some of them are empty)

I'm using Visual studio 2005.

Thank you.
0
whiteteaAuthor Commented:
 This has been solved  as follwing:
                  Dim a As Integer
                    Dim N As Integer
                    Dim M As Integer
                    Dim T As Integer
                    Dim Rs Integer
                    R = 0
                   a=0
                    T=0
                    Dim S1[a] as String
                    Dim S2[a] as String
                    Dim S3[a] as String

                    For a = 0 To N - 1
                              If String.IsNullOrEmpty(S1) = False Then
                                Temp = Temp + 1
                            End If
                            If String.IsNullOrEmpty(S2) = False Then
                                Temp = Temp + 1
                            End If
                            If String.IsNullOrEmpty(S3) = False Then
                                Temp = Temp + 1
                            End If
                             If T>= M Then
                                M = Temp
                                Rs = a
                            End If
                        End With
                    Next a
Response.Write(S1(Rs))
Response.Write(S2(Rs))
Response.Write(S3(Rs))

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.