Connecting Tech Pros Worldwide Forums | Help | Site Map

array from inputbox

portroe
Guest
 
Posts: n/a
#1: Nov 20 '05
How can you populate an array using an inputbox(es)?

thanks

portroe


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 20 '05

re: array from inputbox


* portroe <bob@sleigh.com> scripsit:[color=blue]
> How can you populate an array using an inputbox(es)?[/color]

How doi you want it to be populated?

\\\
Dim astr(4) As String
Dim i As Integer
For i = 0 To 4
astr(i) = ImputBox(...)
Next i
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
One Handed Man [ OHM# ]
Guest
 
Posts: n/a
#3: Nov 20 '05

re: array from inputbox


Dim rep As String = InputBox("Enter Values SeperatedBy Commas")

Dim MyArray() As String = rep.Split(","c)

OHM


portroe wrote:[color=blue]
> How can you populate an array using an inputbox(es)?
>
> thanks
>
> portroe[/color]

--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


Hexathioorthooxalate
Guest
 
Posts: n/a
#4: Nov 20 '05

re: array from inputbox


Bob, a little less information than required for an accurate reply but maybe
what you are asking for is something like this.
Regards
Hexathioorthooxalate


Private Function getArray() As String()
Dim v As ArrayList = New ArrayList
Dim s As String
Do
s = InputBox("enter something or nothing to exit", "inputbox title")
If s <> "" Then v.Add(s)
Loop While s <> ""
Return CType(v.ToArray(GetType(String)), String())
End Function



And to test it use a bit of code like the following.


Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim s As String() = getArray()
For i As Integer = 0 To s.Length - 1
MsgBox(s(i))
Next i
End Sub


"portroe" <bob@sleigh.com> wrote in message
news:OZZvJHV0DHA.3224@tk2msftngp13.phx.gbl...[color=blue]
> How can you populate an array using an inputbox(es)?
>
> thanks
>
> portroe
>[/color]


portroe
Guest
 
Posts: n/a
#5: Nov 20 '05

re: array from inputbox


after the values have been entered using input box technique,
the array will be populated by a button click, as ohm has implemented,

howb can i tell the procees to stop when all array values are completed,

thx

Portroe



Hexathioorthooxalate wrote:
[color=blue]
> Bob, a little less information than required for an accurate reply but maybe
> what you are asking for is something like this.
> Regards
> Hexathioorthooxalate
>
>
> Private Function getArray() As String()
> Dim v As ArrayList = New ArrayList
> Dim s As String
> Do
> s = InputBox("enter something or nothing to exit", "inputbox title")
> If s <> "" Then v.Add(s)
> Loop While s <> ""
> Return CType(v.ToArray(GetType(String)), String())
> End Function
>
>
>
> And to test it use a bit of code like the following.
>
>
> Private Sub Button1_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles Button1.Click
> Dim s As String() = getArray()
> For i As Integer = 0 To s.Length - 1
> MsgBox(s(i))
> Next i
> End Sub
>
>
> "portroe" <bob@sleigh.com> wrote in message
> news:OZZvJHV0DHA.3224@tk2msftngp13.phx.gbl...
>[color=green]
>>How can you populate an array using an inputbox(es)?
>>
>>thanks
>>
>>portroe
>>[/color]
>
>
>[/color]

Armin Zingler
Guest
 
Posts: n/a
#6: Nov 20 '05

re: array from inputbox


"portroe" <bob@sleigh.com> schrieb[color=blue]
> How can you populate an array using an inputbox(es)?[/color]

What is the exact problem? Showing inputboxes? Creating an array? Setting
array items?


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Gary
Guest
 
Posts: n/a
#7: Nov 20 '05

re: array from inputbox


portroe, looking at this message we cannot help you any further. There
is not enough information. If you can't write a full description in
English, write it in any language and someone will translate it
(http://www.freetranslations.com). Provide a full description - what
do you want?

Gary


portroe <bob@sleigh.com> wrote in message news:<OZZvJHV0DHA.3224@tk2msftngp13.phx.gbl>...[color=blue]
> How can you populate an array using an inputbox(es)?
>
> thanks
>
> portroe[/color]
Cor
Guest
 
Posts: n/a
#8: Nov 20 '05

re: array from inputbox


Hi portroe,

You have not to tell it, moreover you cannot stop it when it is busy.

Cor
[color=blue]
> after the values have been entered using input box technique,
> the array will be populated by a button click, as ohm has implemented,
>
> howb can i tell the procees to stop when all array values are completed,
>
> thx[/color]


Closed Thread


Similar Visual Basic .NET bytes