Results 1 to 6 of 6

Thread: IsNumber ???

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    London, UK
    Posts
    58

    Post

    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

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Posts
    23

    Post

    I beleive what your looking for is the isnumeric() function.

  3. #3

    Post

    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).]

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    London, UK
    Posts
    58

    Post

    IsNumeric! How close!

    Thanks all - yes, I was just being thick

    AndyC

  5. #5
    Member
    Join Date
    Nov 1999
    Posts
    32

    Post

    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

  6. #6
    Member
    Join Date
    Nov 1999
    Posts
    32

    Post

    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
  •  



Click Here to Expand Forum to Full Width