Main Page | Report this Page
 
   
.NET DotNet Forum Index  »  VB.NET Forum (Visual Basic .NET)  »  Getting Textbox data into an Array: VB 2008...
Page 1 of 1    
Author Message
GeekBoy...
Posted: Tue Oct 07, 2008 4:02 pm
Guest
I did not see another group for this so I presume this is the correct one to
ask such a question.

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.
Jack Jackson...
Posted: Tue Oct 07, 2008 5:30 pm
Guest
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
<GeekBoy at (no spam) discussions.microsoft.com> wrote:

Quote:
I did not see another group for this so I presume this is the correct one to
ask such a question.

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)
James Hahn...
Posted: Tue Oct 07, 2008 5:36 pm
Guest
Do you mean that each line in the text box is going to be one element in the
array?

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" <GeekBoy at (no spam) discussions.microsoft.com> wrote in message
news:81F5C28D-FC16-44E1-B0C4-1ED27250E687 at (no spam) microsoft.com...
Quote:
I did not see another group for this so I presume this is the correct one
to
ask such a question.

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.
GeekBoy...
Posted: Tue Oct 07, 2008 10:46 pm
Guest
"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
Quote:
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct one
to
ask such a question.

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)


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
James Hahn...
Posted: Wed Oct 08, 2008 12:06 am
Guest
Dim array(15) as integer
Dim j As Integer
Dim s() As String = Split(txtEnterArray.Text, " ")

For j = 0 To S.Length - 1
array(j) = ctype(val(s(j)), Integer)
Next j

"GeekBoy" <nerd_revenge at (no spam) nerdythree.net> wrote in message
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...
Quote:

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct one
to
ask such a question.

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)


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
Cor Ligthert[MVP]...
Posted: Wed Oct 08, 2008 12:09 am
Guest
GeekBoy,

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_revenge at (no spam) nerdythree.net> schreef in bericht
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...
Quote:

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct one
to
ask such a question.

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)


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
GeekBoy...
Posted: Wed Oct 08, 2008 12:52 am
Guest
"Cor Ligthert[MVP]" <notmyfirstname at (no spam) planet.nl> wrote in message
news:19197851-39AA-4617-8191-92FFC534E1D2 at (no spam) microsoft.com...
Quote:

GeekBoy,

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.


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.

Quote:

\\
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.

Quote:
///

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_revenge at (no spam) nerdythree.net> schreef in bericht
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct
one to
ask such a question.

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)


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
GeekBoy...
Posted: Wed Oct 08, 2008 1:04 am
Guest
"James Hahn" <jhahn at (no spam) yahoo.com> wrote in message
news:eeFDmOQKJHA.1012 at (no spam) TK2MSFTNGP04.phx.gbl...
Quote:
Dim array(15) as integer
Dim j As Integer
Dim s() As String = Split(txtEnterArray.Text, " ")

For j = 0 To S.Length - 1
array(j) = ctype(val(s(j)), Integer)
Next j


Thanks a lot John for th eextra help.

GB
Quote:

"GeekBoy" <nerd_revenge at (no spam) nerdythree.net> wrote in message
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct
one to
ask such a question.

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)


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
vbStudent...
Posted: Sat Oct 18, 2008 10:53 pm
Guest
Dear All,

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

"James Hahn" wrote:

Quote:
Dim array(15) as integer
Dim j As Integer
Dim s() As String = Split(txtEnterArray.Text, " ")

For j = 0 To S.Length - 1
array(j) = ctype(val(s(j)), Integer)
Next j

"GeekBoy" <nerd_revenge at (no spam) nerdythree.net> wrote in message
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct one
to
ask such a question.

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)


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

Jack Jackson...
Posted: Sun Oct 19, 2008 12:06 am
Guest
String has a method ToCharArray:

textbox1.Text.ToCharArray()


On Sat, 18 Oct 2008 20:53:00 -0700, vbStudent
<vbStudent at (no spam) discussions.microsoft.com> wrote:

Quote:
Dear All,

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

"James Hahn" wrote:

Dim array(15) as integer
Dim j As Integer
Dim s() As String = Split(txtEnterArray.Text, " ")

For j = 0 To S.Length - 1
array(j) = ctype(val(s(j)), Integer)
Next j

"GeekBoy" <nerd_revenge at (no spam) nerdythree.net> wrote in message
news:2990589F-5858-48AE-96CF-78518D8995DF at (no spam) microsoft.com...

"Jack Jackson" <jjackson at (no spam) cinnovations.net> wrote in message
news:kfone4dhs0q952babtifmd7gjl2vgcp2j1 at (no spam) 4ax.com...
On Tue, 7 Oct 2008 14:02:03 -0700, GeekBoy
GeekBoy at (no spam) discussions.microsoft.com> wrote:

I did not see another group for this so I presume this is the correct one
to
ask such a question.

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)


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

 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Mon Dec 01, 2008 3:42 pm