Click here to Skip to main content
15,897,273 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Vb.net Break Down Number HELP Pin
helelark1238-Sep-09 8:48
helelark1238-Sep-09 8:48 
AnswerRe: Vb.net Break Down Number HELP Pin
helelark1238-Sep-09 2:03
helelark1238-Sep-09 2:03 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 2:36
PAguilar098-Sep-09 2:36 
AnswerRe: Vb.net Break Down Number HELP Pin
Johan Hakkesteegt8-Sep-09 3:21
Johan Hakkesteegt8-Sep-09 3:21 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 10:41
PAguilar098-Sep-09 10:41 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 11:15
PAguilar098-Sep-09 11:15 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 19:58
PAguilar098-Sep-09 19:58 
GeneralRe: Vb.net Break Down Number HELP Pin
Johan Hakkesteegt8-Sep-09 20:32
Johan Hakkesteegt8-Sep-09 20:32 
The question you first need to ask yourself is, how large a number can the user possibly enter? In other words, you will first have to determine how many positions you will have to report on (singles, tens, hundreds, thousands, tenthousands, hundredthousands, etc). In yet other words, how many textboxes will you need to put on your form?

So as Liqz suggested, it might be best to use Chars, and an array first, before using a loop.
Something like:
Dim PositionsArray() As Char = TextBox1.Text.ToCharArray
Now you can easily determine the number of characters:
Dim AmountOfPositions As Integer = PositionsArray.Length
Now you almost know how many positions you will have to handle. But what if we use your example: 105,749 ? This has a comma in the middle, which is also a position, but not a number.
Here you could use a For Each loop:
For Each c As Char In PositionsArray
 'This will loop through the characters from left to right'
 'Then play around with the possiblities of the Char type:'
 If Not Char.IsDigit(c) Then
   MsgBox("I found something other than a number (" & c.ToString & ")" & _
          " at index: " & Array.IndexOf(PositionsArray, c))
 End If
Next


Next you could look into the Case statement. like Steven suggested below.

My advice is free, and you may get what you paid for.

GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar099-Sep-09 1:34
PAguilar099-Sep-09 1:34 
AnswerRe: Vb.net Break Down Number HELP Pin
Steven J Jowett8-Sep-09 4:56
Steven J Jowett8-Sep-09 4:56 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar099-Sep-09 1:32
PAguilar099-Sep-09 1:32 
GeneralRe: Vb.net Break Down Number HELP Pin
Jay Royall9-Sep-09 2:25
Jay Royall9-Sep-09 2:25 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar099-Sep-09 3:21
PAguilar099-Sep-09 3:21 
GeneralRe: Vb.net Break Down Number HELP Pin
Jay Royall9-Sep-09 3:40
Jay Royall9-Sep-09 3:40 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar0912-Sep-09 19:48
PAguilar0912-Sep-09 19:48 
GeneralRe: Vb.net Break Down Number HELP Pin
Johan Hakkesteegt9-Sep-09 3:05
Johan Hakkesteegt9-Sep-09 3:05 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar099-Sep-09 3:28
PAguilar099-Sep-09 3:28 
AnswerRe: Vb.net Break Down Number HELP Pin
Ian Shlasko8-Sep-09 5:47
Ian Shlasko8-Sep-09 5:47 
AnswerRe: Vb.net Break Down Number HELP Pin
dan!sh 8-Sep-09 7:55
professional dan!sh 8-Sep-09 7:55 
QuestionCache datatable [modified] Pin
helelark1237-Sep-09 23:10
helelark1237-Sep-09 23:10 
AnswerRe: Cache datatable Pin
helelark1237-Sep-09 23:56
helelark1237-Sep-09 23:56 
GeneralRe: Cache datatable Pin
Ashfield8-Sep-09 1:22
Ashfield8-Sep-09 1:22 
GeneralRe: Cache datatable Pin
helelark1238-Sep-09 1:56
helelark1238-Sep-09 1:56 
QuestionPass selected row in Datagrid view to another datagrid on another form Pin
ShabRaza7-Sep-09 12:09
ShabRaza7-Sep-09 12:09 
AnswerRe: Pass selected row in Datagrid view to another datagrid on another form Pin
Christian Graus7-Sep-09 12:39
protectorChristian Graus7-Sep-09 12:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.