By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,804 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,804 IT Pros & Developers. It's quick & easy.

IsNumeric problem....

P: n/a
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")

If IsNumeric(StrTemp) 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(strVal)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(path))
End Function

--

Regards

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

Keeping it FREE!


Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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*************@TK2MSFTNGP11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")

If IsNumeric(StrTemp) 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(strVal)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(path))
End Function

Jul 19 '05 #2

P: n/a
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>/?AA4556FF354DSF723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strTemp Then
If IsNumeric(StripQStr(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*************@TK2MSFTNGP11.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*************@TK2MSFTNGP11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")

If IsNumeric(StrTemp) 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(strVal)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(path))
End Function


Jul 19 '05 #3

P: n/a
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**************@tk2msftngp13.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>/?AA4556FF354DSF723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strTemp Then
If IsNumeric(StripQStr(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*************@TK2MSFTNGP11.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*************@TK2MSFTNGP11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")

If IsNumeric(StrTemp) 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(strVal)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(path))
End Function



Jul 19 '05 #4

P: n/a
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")=strTemp Then
RESPONSE.WRITE rst("QS") & ": "
If IsNumeric(StripQStr(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**************@tk2msftngp13.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>/?AA4556FF354DSF723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strTemp Then
If IsNumeric(StripQStr(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*************@TK2MSFTNGP11.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*************@TK2MSFTNGP11.phx.gbl...
Anyone have any why the following, returns true?

'// Leave everything after the ?
strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")

If IsNumeric(StrTemp) 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(strVal)
Dim path
path = Split(strVal, "?")
StripQStr = path(UBound(path))
End Function



Jul 19 '05 #5

P: n/a
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**************@tk2msftngp13.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")=strTemp Then
RESPONSE.WRITE rst("QS") & ": "
If IsNumeric(StripQStr(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**************@tk2msftngp13.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>/?AA4556FF354DSF723

I'm pulling the fields from the database using;

Do Until rst.eof
If rst("URL")=strTemp Then
If IsNumeric(StripQStr(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*************@TK2MSFTNGP11.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*************@TK2MSFTNGP11.phx.gbl...
> Anyone have any why the following, returns true?
>
> '// Leave everything after the ?
> strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822")
>
> If IsNumeric(StrTemp) 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(strVal)
> Dim path
> path = Split(strVal, "?")
> StripQStr = path(UBound(path))
> End Function



Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.