473,804 Members | 4,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsNumeric problem....

Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")

If IsNumeric(StrTe mp) Then
Response.Write strTemp & " is numeric"
else
Response.Write strTemp & " is not numeric"
end if

'// Function to strip everything upto and including the "?"
'// and return only the string after it.

Function StripQStr(strVa l)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(pat h))
End Function

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


Jul 19 '05 #1
5 1518
Do you have your computer plugged in with the outlet upside down? It
doesn't return true for me!

XP Pro, WSH 5.6.

Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eb******** *****@TK2MSFTNG P11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")

If IsNumeric(StrTe mp) Then
Response.Write strTemp & " is numeric"
else
Response.Write strTemp & " is not numeric"
end if

'// Function to strip everything upto and including the "?"
'// and return only the string after it.

Function StripQStr(strVa l)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(pat h))
End Function

Jul 19 '05 #2
hehe, not quite........

Basically what is happening is, I've got URL's stored in a database, e.g.;

http://<domain>/?querystring (alphanumeric)

I use the function I mentioned, to strip the querystring so I can check that
it contains only numeric characters. So for example;

'// This should return true
http://<domain>/?12345

'// should return false
http://<domain>/?AA4556FF354DSF 723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strT emp Then
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
Exit Do
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
End If
End if
rst.movenext
Loop

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#X******** *****@TK2MSFTNG P11.phx.gbl...
Do you have your computer plugged in with the outlet upside down? It
doesn't return true for me!

XP Pro, WSH 5.6.

Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eb******** *****@TK2MSFTNG P11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")

If IsNumeric(StrTe mp) Then
Response.Write strTemp & " is numeric"
else
Response.Write strTemp & " is not numeric"
end if

'// Function to strip everything upto and including the "?"
'// and return only the string after it.

Function StripQStr(strVa l)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(pat h))
End Function


Jul 19 '05 #3
I should have added, the server is running on Windows 2000 and AFAIK, has
WSH 5.6 (it's not my server and the info isn't available, so don't know for
sure which version is running........ )

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Steven Burn" <pv*@noyb.com > wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
hehe, not quite........

Basically what is happening is, I've got URL's stored in a database, e.g.;

http://<domain>/?querystring (alphanumeric)

I use the function I mentioned, to strip the querystring so I can check that it contains only numeric characters. So for example;

'// This should return true
http://<domain>/?12345

'// should return false
http://<domain>/?AA4556FF354DSF 723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strT emp Then
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
Exit Do
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
End If
End if
rst.movenext
Loop

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#X******** *****@TK2MSFTNG P11.phx.gbl...
Do you have your computer plugged in with the outlet upside down? It
doesn't return true for me!

XP Pro, WSH 5.6.

Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eb******** *****@TK2MSFTNG P11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")

If IsNumeric(StrTe mp) Then
Response.Write strTemp & " is numeric"
else
Response.Write strTemp & " is not numeric"
end if

'// Function to strip everything upto and including the "?"
'// and return only the string after it.

Function StripQStr(strVa l)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(pat h))
End Function



Jul 19 '05 #4
Is there more to it than that? Is there anything that's giving a value to
the function before the loop? What about:

Do Until rst.eof
If rst("URL")=strT emp Then
RESPONSE.WRITE rst("QS") & ": "
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
'Exit Do let's not exit while testing
RESPONSE.WRITE "TRUE<BR>"
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
RESPONSE.WRITE "FALSE<BR>"
End If
End if
rst.movenext
Loop

RESPONSE.END
Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
hehe, not quite........

Basically what is happening is, I've got URL's stored in a database, e.g.;

http://<domain>/?querystring (alphanumeric)

I use the function I mentioned, to strip the querystring so I can check that it contains only numeric characters. So for example;

'// This should return true
http://<domain>/?12345

'// should return false
http://<domain>/?AA4556FF354DSF 723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strT emp Then
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
Exit Do
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
End If
End if
rst.movenext
Loop

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#X******** *****@TK2MSFTNG P11.phx.gbl...
Do you have your computer plugged in with the outlet upside down? It
doesn't return true for me!

XP Pro, WSH 5.6.

Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eb******** *****@TK2MSFTNG P11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")

If IsNumeric(StrTe mp) Then
Response.Write strTemp & " is numeric"
else
Response.Write strTemp & " is not numeric"
end if

'// Function to strip everything upto and including the "?"
'// and return only the string after it.

Function StripQStr(strVa l)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(pat h))
End Function



Jul 19 '05 #5
strTemp is just a regular URL (i.e. domain.com/page.html), that part works
fine.

I've just done a response.write and figured out where it was going wrong.

It was finding the first match only, and regardless of whether it was
numeric or not, was returning the boolean.

cheers Ray ;o)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#T******** ******@tk2msftn gp13.phx.gbl...
Is there more to it than that? Is there anything that's giving a value to
the function before the loop? What about:

Do Until rst.eof
If rst("URL")=strT emp Then
RESPONSE.WRITE rst("QS") & ": "
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
'Exit Do let's not exit while testing
RESPONSE.WRITE "TRUE<BR>"
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
RESPONSE.WRITE "FALSE<BR>"
End If
End if
rst.movenext
Loop

RESPONSE.END
Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
hehe, not quite........

Basically what is happening is, I've got URL's stored in a database, e.g.;
http://<domain>/?querystring (alphanumeric)

I use the function I mentioned, to strip the querystring so I can check

that
it contains only numeric characters. So for example;

'// This should return true
http://<domain>/?12345

'// should return false
http://<domain>/?AA4556FF354DSF 723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strT emp Then
If IsNumeric(Strip QStr(rst("QS")) ) Then
TheFunction = True
Exit Do
Else
'// Nothing (if it's false, I don't want to know
'// about it as the script will only process
'// when it is false)
End If
End if
rst.movenext
Loop

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#X******** *****@TK2MSFTNG P11.phx.gbl...
Do you have your computer plugged in with the outlet upside down? It
doesn't return true for me!

XP Pro, WSH 5.6.

Ray at home

"Steven Burn" <pv*@noyb.com > wrote in message
news:eb******** *****@TK2MSFTNG P11.phx.gbl...
> Anyone have any why the following, returns true?
>
> '// Leave everything after the ?
> strTemp = StripQStr("/?DD0898SDFSDFSD 89Q2ASD8822")
>
> If IsNumeric(StrTe mp) Then
> Response.Write strTemp & " is numeric"
> else
> Response.Write strTemp & " is not numeric"
> end if
>
> '// Function to strip everything upto and including the "?"
> '// and return only the string after it.
>
> Function StripQStr(strVa l)
> Dim path
> path = Split(strVal, "?")
> StripQStr = path(UBound(pat h))
> End Function



Jul 19 '05 #6

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

Similar topics

8
2325
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the following function in a validating class to use when needed. (Value = H880118A gave the error (like other 'unconvertible' strings)) Public Function Numeric(ByVal value) As Boolean
4
13276
by: Eugene Anthony | last post by:
I have received the following feedback for the two functions bellow: "The ISNUMERIC test is WORTHLESS for checking for an INT value, because ISNUMERIC will happily accept DOUBLE values, such as 89.11998811777 and other values that are simply *NOT* INT values." <% function isZip(input)
14
40148
by: Kenny | last post by:
Hello, I would like to know if the function IsNumeric requires a header like #include <iostream> to be functionnal thanks ken
8
2614
by: John Bowman | last post by:
Hello, Does anyone have a good/reliable approach to implementing an IsNumeric() method that accepts a string that may represent a numerical value (eg. such as some text retrieved from an XML file)? Thus if you pass it "1" or "5.12345" it returns true, but "1b3q" it returns false? I know VB has this sort of function, but was wondering how to implement something similar in C#. I suppose I could use the Convert methods and catch any...
3
1969
by: Radith Silva | last post by:
Dear All; Thanx for helpt with previous question. Still learning?? FROM A VB 6.0 BOOK: any way; I have used IsNumeric function and check all namespace conflicts and all and nothing seems to solve the error.
10
2802
by: michele | last post by:
I have a problem with VB.Net and IsNumeric() function because it always returns FALSE even the string can be a number. There is another strange thing, the same program (it is a test) runs good on one and doesn't run an another one. The program test is very simple, just a form with a text box and a button. The text box has a validation rule that check if the insert string is a numeric value, that's all.
7
2386
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a section that lists the Times, Buildings and rooms for courses. In this section I have a function called PadCell that takes3 parameters, one the value, one a padd count and one a a boolean input called StripNumeric, that if true, checks if the value...
8
2591
by: moondaddy | last post by:
What's the .net framework equivalent of the vb function isnumeric? If there isn't one, how can I test a string variable to see if its a number or not? I don't want to use isnumeric if possible -- moondaddy@noemail.noemail
12
3068
by: sck10 | last post by:
Hello, I am trying to determine if a value is NOT numeric in C#. How do you test for "Not IsNumeric"? protected void fvFunding_ItemInserting_Validate(object sender, FormViewInsertEventArgs e) if (e.NewValues != "" && Not IsNumeric(e.NewValues)) {
17
2302
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10330
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
10319
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
9144
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...
0
6851
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.