Ask a Question related to ASP, Design and Development.
-
K #1
ASP comparison question...
hi guys,
I am doing this here:
dim i
dim j
i = 10
j = 10
If i = j then
But it is giving me a false result...
Any ways to do this comparison so it gives me the proprer result?
Thanx.
K Guest
-
Easy for u--comparison
Hola.I am trying compare two phone numbers...How I will do ? Example: if (646) 333-3666 like (646) % ,do that... in coldfusion, how would you do... -
String Comparison
im having trouble comparing two strings togeather. this code always returns false. please help! -
comparison between two regexes?
Given two regex patterns R1 and R2, is it possible at all to determine/calculate: - whether R1 is "a subset of" R2, i.e. all strings that match... -
Mac - PC Comparison
How does a Mac G3 333mhz compare to a 800 mhz P3 PC? -
raw vs. ufs comparison
Hi there! someone wrote: It does. When using the raw device, any I/O is done synchronously. When using UFS, only metadata is written... -
Ray at #2
Re: ASP comparison question...
Are you sure this is all there is to it? Just that code alone should return
true, but if you're assinging i and j by some other means, it's likely that
one of them is a string and one is an integer, or something along those
lines. Doing this will take care of it though:
If CInt(i) = CInt(j) Then...
Depending on what kind of values you're using, you may want CLng to avoid an
overflow, i.e.
i = 32938493
j = 32938493
If CInt(i) = CInt(j) Then
'''Will cause an overflow
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vbsvariables.asp[/url]
Ray at work
"K" <n_kom@videotron.ca> wrote in message
news:MbtWa.14679$Sn.185155@wagner.videotron.net...> hi guys,
>
>
> I am doing this here:
>
> dim i
> dim j
>
> i = 10
> j = 10
>
> If i = j then
>
> But it is giving me a false result...
>
> Any ways to do this comparison so it gives me the proprer result?
>
> Thanx.
>
>
>
>
Ray at Guest
-
Bob Barrows #3
Re: ASP comparison question...
K wrote:
Well, I can't reproduce your error.> hi guys,
>
>
> I am doing this here:
>
> dim i
> dim j
>
> i = 10
> j = 10
>
> If i = j then
>
> But it is giving me a false result...
>
> Any ways to do this comparison so it gives me the proprer result?
>
> Thanx.
This:
dim i
dim j
i = 10
j = 10
If i = j then
Response.Write "Equal"
else
Response.Write "Not Equal"
end if
Response.End
gives this result:
Equal
Suggestion: force both variable to the same data subtype:
i=cint(10)
j=cint(10)
HTH,
Bob Barrows
Bob Barrows Guest
-
K #4
Re: ASP comparison question...
I am actually doi ng this:
i = request.form("var1")
j = request.form("var2")
And later, I do;
If i = j then
response.write
Else
response.write
End If
when I try =" or ,+, one return true, the other one false.
So I guess it is comparing the value in itself and not what it holds.
If I do Cint(j) I will get the actual value of the letter won't I?
Thx.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uSB6fsCWDHA.2476@tk2msftngp13.phx.gbl...return> Are you sure this is all there is to it? Just that code alone shouldthat> true, but if you're assinging i and j by some other means, it's likelyan> one of them is a string and one is an integer, or something along those
> lines. Doing this will take care of it though:
>
> If CInt(i) = CInt(j) Then...
>
>
> Depending on what kind of values you're using, you may want CLng to avoid[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht[/url]> overflow, i.e.
> i = 32938493
> j = 32938493
>
> If CInt(i) = CInt(j) Then
> '''Will cause an overflow
>
ml/vbsvariables.asp>
> Ray at work
>
>
> "K" <n_kom@videotron.ca> wrote in message
> news:MbtWa.14679$Sn.185155@wagner.videotron.net...>> > hi guys,
> >
> >
> > I am doing this here:
> >
> > dim i
> > dim j
> >
> > i = 10
> > j = 10
> >
> > If i = j then
> >
> > But it is giving me a false result...
> >
> > Any ways to do this comparison so it gives me the proprer result?
> >
> > Thanx.
> >
> >
> >
> >
>
K Guest



Reply With Quote

