473,703 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>Yo u must enter the unique code for each item to
continue</td></tr>"
response.write "<tr><td align='center'> <a
href='javascrip t:history.back( );'>Please go back and re-enter</td></tr>"
Response.end
Else
Response.Write "<tr><td>Th e Codes are unique</td></tr>"
response.write "<tr><td align='center'> <a
href='javascrip t:history.back( );'>Please go back and re-enter</td></tr>"
Response.end
End If
Next
Jul 22 '05 #1
1 2764
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
2837
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 programming with some occasional VB and web programming with ASP. Prior to that I went to a technical college where I took a couple of courses in c, c++ and pascal. Although now about all I can do is the basic "hello world" type applications in...
303
17659
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. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
1
3257
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 calculation with a programming language, say C#, or should I just use sql to do it on the sql server. An obvious advantage of doing it in the sql server is that you dont need to transfer the data between the sql server and he application server.
16
2069
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, sketching it out: <?php if (isset($_POST) && $_POST=="Submit") { ---Do a bunch of stuff--- if (isset($_SESSION)) unset($_SESSION);
28
2264
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 modified: " + document.lastModified); --> </script>
32
4042
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 js equivalent, or some other way to handle this? Andrew Poulos
6
51159
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 help people display some nice widgets quickly without explaining some issues that need to be tackled when a full application needs to be developed. This article does not go into full implementation details because those can be found by reading the...
3
9998
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 list, I realised a number of the issues will vary greatly from country to country. So I tried to make this advice as general as possible. You should investigate further the legal differences for your country. 1. Contractual Relationship Being an...
0
9123
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6594
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5923
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2462
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.