Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string compare again

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hi....
how can i use strcomp to compare all this string and make sure it's not similar. if it's similar, message will be prompt to the user.

str1, str2, str3, str4, str5, str6, str7


is there any other function to do this task?

what about instr?

thanks for the help
rOn
 
Could you elaborate.

By similar, presumably you mean the same?

Are str1, str2... variables holding different strings?
If they are do you want to compare them all with each other, or compare another string with each of them.

Or does the string contain "str1, str2, str3"?

 
yes, similar means the same and i'm comparing the string each other and not with different string. actually the variable came from the same form control which is the select box. I made this way, when the user select an item from the select box, the value of the item will goes to str1, the second time he select , the value will goes to str2 and so forth. Iwant to make sure that the user will not select the same item more than 1 time. Is there any other way of doing this?

Thanks,
New in ASP
rOnAdIa
 
I think you should use Dictionary. Add the strX to Dictionary if it does not exist in there.

For intCounter = 1 to NumberOfString
...If Not Exist in Dictionary
... add into Dictionary ...
...End If
Next

If you just want to get distinct strXs, that is it. If you want to know whether user selects one strX more than once or not, then compare NumberOfString with UBound(Dictionary.Items)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top