-
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
-
I beleive what your looking for is the isnumeric() function.
-
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).]
-
IsNumeric! How close!
Thanks all - yes, I was just being thick :)
AndyC
-
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
-
Andy
Oh, you just got it before you read my reply.
My connection is very slow....
ROSE