Results 1 to 3 of 3

Thread: code for user entered "1,234.55" prints out One Thousand Two Hundred ect....Please

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    Morton, IL. usa
    Posts
    4

    Post

    i'm a beginner trying to write a check writing program where the user enters the numbers ( 1,2,5 ect...) and the program writes the check ( one , two, five ect...).
    but I can' figure out how to identifiy the first number in a string of text. then the second Number in text and so on.
    all help is greatly appreciated.
    thanks!!!!

  2. #2
    Member
    Join Date
    Jan 1999
    Location
    Gig Harbor, WA, USA
    Posts
    48

    Post

    Try this (where TextString is the variable or object holding the number, and the array Numbers() holds the individual numbers):

    Code:
    Dim Numbers(), temp As Integer
    For i = 0 to Len(TextString) - 1
    temp = Mid(TextString, i, 1)
    If IsNumeric(temp) Then
    Numbers(i) = temp
    End if
    Next i
    This will place each individual number into it's respective slot in the array, while filtering out anything that isn't a number. For example, if TextString is "9,264.56", then the array will hold this data:

    Numbers(0) = 9
    Numbers(1) = 2
    Numbers(2) = 6
    Numbers(3) = 4
    Numbers(4) = 5
    Numbers(5) = 6

    Hope this helps!

    ------------------
    (¯`·.¸¸.·´¯`·->ShadowCrawler<-·´¯`·.¸¸.·´¯)
    Teenage Programmer
    Visual Basic, HTML, C++, JavaScript

    http://welcome.to/X12Tech
    Email: [email protected]
    ICQ#: 9872708

  3. #3
    New Member
    Join Date
    Jun 1999
    Location
    Northampton, MA
    Posts
    10

    Post

    If you want you can check this: VB-world Tip #108

    ------------------
    Marek Karbarz
    My WebPage
    [email protected]

    [This message has been edited by Slimak (edited 11-07-1999).]

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