473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

strComp not doing what it should

Ok i need to compare 2 values from my array but strComp no matter what
returns 1 even though my comparison values are the same

if i do this

str1 = "wed"
str2 = "wed"
strComp(str1, str2) 'returns 0

but if i do

str1 = code(0)
str2 = code(1)
both are "wed" but it returns 1

however if i do

strComp(code(0), code(0)) 'returns 0

I am unsure why it returns 1 even when they are the same, i have even tried
cstr(code(0)) but it still returns 1

my code i am going to use in my page is but its probably irrelevant as its
suffering from same problems as outlined above

tia for the help

For i = 1 to loopcount
If strComp(code(0), code(i), 0) = 0 Then
Response.Write "<tr><td>You must enter the unique code for each item to
continue</td></tr>"
response.write "<tr><td align='center'><a
href='javascript:history.back();'>Please go back and re-enter</td></tr>"
Response.end
Else
Response.Write "<tr><td>The Codes are unique</td></tr>"
response.write "<tr><td align='center'><a
href='javascript:history.back();'>Please go back and re-enter</td></tr>"
Response.end
End If
Next
Jul 22 '05 #1
1 2755
steven scaife wrote:
Ok i need to compare 2 values from my array but strComp no matter what
returns 1 even though my comparison values are the same

if i do this

str1 = "wed"
str2 = "wed"
strComp(str1, str2) 'returns 0

but if i do

str1 = code(0)
str2 = code(1)
both are "wed" but it returns 1

however if i do

strComp(code(0), code(0)) 'returns 0

I am unsure why it returns 1 even when they are the same, i have even
tried cstr(code(0)) but it still returns 1

my code i am going to use in my page is but its probably irrelevant
as its suffering from same problems as outlined above

tia for the help


I think your array does not contain what you think it contains. This code
returns 0 when I run it:

<%
dim code(1)
code(0) = "wed"
code(1) = "wed"
Response.Write StrComp(code(0),code(1))
%>

Response-write your values to verify the array contains what you expect it
to contain.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Benjamin | last post by:
Hello, I need some advice on a financial application I'm doing. First, I suppose I should give a little background so you know where I'm coming from. For 5 years I earned my living doing COBOL...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
1
by: Benny | last post by:
Hi, I would like to know, if I need to do some floting point operations (mainly multiplication and division) on each roll of a table, should I read the data out from the DB and do the...
16
by: Shelly | last post by:
(posted previously on comp.lang.php but no response received. Cross-posted in the dreamweaver forum) I am confused about what goes on with method POST. Here is an overview of a my code,...
28
by: fred.haab | last post by:
Not having server side scripting, I've been doing this for "last modified" tags on my pages: <div class="modified"> <script type="Text/JavaScript"> <!-- document.write("This page was last...
32
by: Andrew Poulos | last post by:
I'm writing some ASP using js and I need to do a case sensitive SQL select. Googling gave me this: SELECT * FROM User WHERE Strcomp("Blue",,vbBinaryCompare)=0 Strcomp is from vbs. Is there a...
6
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
3
MMcCarthy
by: MMcCarthy | last post by:
If you are thinking about setting up as an Independent Contractor there are a number of factors you should consider about how that would change the way in which you work. While thinking about this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.