|
-
Dec 1st, 1999, 10:23 PM
#1
Thread Starter
Member
Can't find this anywhere - is there a way of checking that a string contains just digits and can therefore be converted to an integer before trying it? I thought there was an IsNumber function but evidently not. Am I just looking for the wrong thing?
TIA,
AndyC
London
-
Dec 1st, 1999, 10:35 PM
#2
Junior Member
I beleive what your looking for is the isnumeric() function.
-
Dec 1st, 1999, 10:46 PM
#3
Member
The function you looking for is IsNumeric(x) function but if later you try to convert number like 12.3 to integer it will the function
Code:
Dim int As Integer
Dim str As String
str = "12.3"
if IsNumeric(str) Then int = CInt(str)
int will be 12
Try it.
[This message has been edited by Kiron (edited 12-02-1999).]
-
Dec 1st, 1999, 10:53 PM
#4
Thread Starter
Member
IsNumeric! How close!
Thanks all - yes, I was just being thick 
AndyC
-
Dec 1st, 1999, 11:04 PM
#5
Member
You are looking for the Isnumeric function. It is used for converting between string and numbers. It also returns true if a string can represent a number.
i.e. 1 = 1
-1 = -1
ROSE
-
Dec 1st, 1999, 11:13 PM
#6
Member
Andy
Oh, you just got it before you read my reply.
My connection is very slow....
ROSE
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|