|
-
Nov 6th, 1999, 01:55 PM
#1
Thread Starter
New Member
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!!!!
-
Nov 6th, 1999, 02:01 PM
#2
Member
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
-
Nov 6th, 1999, 02:50 PM
#3
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|