Click to See Complete Forum and Search --> : code for user entered "1,234.55" prints out One Thousand Two Hundred ect....Please
cspenny
Nov 6th, 1999, 12:55 PM
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!!!!
ShadowCrawler
Nov 6th, 1999, 01:01 PM
Try this (where TextString is the variable or object holding the number, and the array Numbers() holds the individual numbers):
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: craigkovatch@compuserve.com
ICQ#: 9872708 (http://wwp.mirabilis.com/9872708)
Slimak
Nov 6th, 1999, 01:50 PM
If you want you can check this: VB-world Tip #108 (http://www.vb-world.net/misc/tip108.html)
------------------
Marek Karbarz
My WebPage (http://members.spree.com/sports/slimak)
Zarembisty@aol.com
[This message has been edited by Slimak (edited 11-07-1999).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.