array from inputbox

  • Thread starter Thread starter portroe
  • Start date Start date
portroe said:
How can you populate an array using an inputbox(es)?

What is the exact problem? Showing inputboxes? Creating an array? Setting
array items?
 
* portroe said:
How can you populate an array using an inputbox(es)?

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
///
 
Dim rep As String = InputBox("Enter Values SeperatedBy Commas")

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

OHM
 
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
 
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
 
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
 
Back
Top