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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string conversion

Status
Not open for further replies.

taval

Programmer
Jul 19, 2000
192
GB
I have an array of strings and a normal string, I want to comapre them both do I need to convert the array to a string, this is what I currently do to compare them

array(whatevernumber) = lineoftext

but this does not seem to work.

How do I compare strings?

Thanks
 
There's a function strComp() to start with.
Look in the article about it in MSDN Library.
 
my code looks like this:

------
While not rsFiles.EOF

file = rsFiles("FileName")
rtn = InStr(1,file, ".")
if rtn > 0 then
extension = Right(file, (Len(file)-rtn+1))
end if

for l=0 to 49

if strComp(Cstr(extArray(l)),extension,1)=0 then
exit for
else
extArray(arrayinc) = extension
arrayinc= arrayinc + 1
exit for
end if
next

rsFiles.MoveNext
wend

for l=0 to 49
%>

<tr><TD BGCOLOR=&quot;#99FF99&quot;> <% Response.write extArray(l) %></TD></TR>
<%
next
-------------------------

Currently all the extensions are shown in the array, thats why I think my string comparision doesn't work.
If anyone can see a probelm could they plz tell me whats wrong. The code is meant to swift out all the duplicate extensions and leave only distinct extenstions in the array.

Thanks
 
Taval,
check your yesterday's post &quot;converting to asp code&quot;.
There's an answer for your question there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top