Anyway, I need to get data entered into a textbox and put it all into an
array. I have looked and cannot find such an example of how to accomplish
this.
What I am trying to do it type in a set of numbers (e.g. 10 20 30....) and
fill in an array with those numbers.
Thanks for any gudiance.
The String.Split method will break up a string.
Dim nums() as String = textbox1.Text.Split(" "c)
Dim s() = Split(TextBox1.Text, vbCrLf)
Or is it one line in the text box with mumbers separated by spaces?
Dim s() = Split(TextBox1.Text, " ")
"GeekBoy" <Gee...@discussions.microsoft.com> wrote in message
news:81F5C28D-FC16-44E1...@microsoft.com...
Thanks for the reply.
Here is what I got so far. I guess I need to do some more reading on this. I
really do not have the time at this moment.
Dim array = New Integer(0 To 15) {}
Dim j As Integer
Dim s() As String = Split(txtEnterArray.Text, " ")
For j = 1 To array.GetLength(0)
s(j) = array(j)
Next j
GB
For j = 0 To S.Length - 1
array(j) = ctype(val(s(j)), Integer)
Next j
"GeekBoy" <nerd_r...@nerdythree.net> wrote in message
news:2990589F-5858-48AE...@microsoft.com...
Why do you make it yourself so difficult.
Jack gave you the complete answer, that is all you need.
You asked about numbers, as you mean values by instance integers, you can do
after that.
\\
dim x(nums.length - 1) as integer
For i = 0 to nums.length - 1
x(i) = CInt(nums(x))
next
///
You have to check f the numbers are real a values, however that is again
another question.
Be aware the above code can contains typos because I typed it direct in this
message
Cor
"GeekBoy" <nerd_r...@nerdythree.net> schreef in bericht
news:2990589F-5858-48AE...@microsoft.com...
Sorry, I do C++. This is actually easier in C++ than Visual "Basic" as no
conversion, flipping, manipulation, etc is needed. Just define the data
type and accept input.
>
> \\
> dim x(nums.length - 1) as integer
> For i = 0 to nums.length - 1
> x(i) = CInt(nums(x))
> next
Thanks for your input also.
Thanks a lot John for th eextra help.
GB
I want to sign textbox string data to array, each letter in one index.
i.e. if I write in the textbox vb.net .. I need to store store it in an
array as following
array(0)=v
array(1)=b
array(2)=.
array(3)=n
array(4)=e
array(5)=t
How can I do that .. please reply me soon.
Thanks for your cooperation
textbox1.Text.ToCharArray()