Quote:
Originally posted by RBCC
[SIZE=3]Structure trans[Structure trans
Dim number As Integer
Dim type As String
Dim amount As Single
End Structure
Dim transaction As trans
Dim fv As StreamReader = File.OpenText("trans.txt")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim transarray As New ArrayList
Dim trans_array As New ArrayList
Dim icounter As Int16
transarray = get_transactions(trans_array)
output_transactions(transarray)
End Sub
Function get_transactions(ByRef array As ArrayList) As ArrayList
Dim trans_counter As Integer
Dim trans_read() As String
Do
trans_read = fv.ReadLine.Split(","c)
transaction.amount = trans_read(0)
transaction.type = Convert.ToString(trans_read(1))
transaction.number = trans_read(2)
array.Add(transaction)
trans_counter = +1
Loop Until fv.Peek = -1
Return array
End Function
Private Sub output_transactions(ByVal array As ArrayList)
Dim transactions As trans
Dim trans_counter As Integer
For Each transactions In array
lstaccounts.Items.Add(transactions.number)
Next
End Sub
Private Sub lstaccounts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstaccounts.SelectedIndexChanged
Dim trans_array As ArrayList
txt_type.Text = transaction.type
txt_amount.Text = transaction.amount
End Sub/SIZE]
:confused: :wave:
I am trying to get the transaction type and amount to be outputted to the textboxes when the user click on an account number in the list box . Where did I go wrong