Results 1 to 4 of 4

Thread: number?

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    how do i find out if the first letter of a string is a number?

  2. #2

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    don't worry i've figured it out

    Code:
    Private Sub Form_Load()
    MsgBox CheckNumber("01243")
    End Sub
    Function CheckNumber(strString As String) As Boolean
    Dim myAsc As Integer
    myAsc = Asc(strString)
    If myAsc >= 48 And myAsc <= 57 Then
    CheckNumber = True
    Else
    CheckNumber = False
    End If
    End Function

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Thumbs up

    How about

    Code:
    If IsNumeric(Left$(My_String,1)) = True Then
       'It's numeric !
    Else
       ' It's Not !
    End If
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  4. #4

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    ok, that way is easier but i didn't know about it

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