Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Array Values in Msgbox

Status
Not open for further replies.

txgeekgirl1

Programmer
Sep 10, 2009
85
0
0
US
I have an array that I know is populating with initial values but I cannot see the results because it won't display. How can I get it to display like a msgbox?

Code:
 Sub SaveDestFile()
        Dim StaffCode As String
        Dim MyRec As String
        Dim Duration As String
        Dim FlagMe As String
        Dim PayerCode As String
        Dim MyCount As Integer
        Dim PArray(10, 2) As String
        Dim c As Integer
        Dim r As Integer

        MyCount = 0

        FileOpen(1, MyFile, OpenMode.Input)
        Do While Not EOF(1)
            MyRec = LineInput(1)
            StaffCode = GetField(MyRec, 5)
            PayerCode = GetField(MyRec, 12)
            Duration = GetField(MyRec, 10)


            If StaffCode = MyStaff Then
                If Duration <> "0.00" Then
                    For r = 0 To 10
                        PArray(r, 1) = PayerCode
                        For Each PayerCode In PArray
                            PArray(r, 2) = MyCount + 1
                        Next
                    Next
                End If
            End If
        Loop


        FileClose(1)


    End Sub
 
Something like this should work
Code:
        Dim s As String = ""
        For i As Integer = 0 To PArray.GetUpperBound(0)
            For j As Integer = 0 To PArray.GetUpperBound(1)
                s &= PArray(i, j) & ControlChars.Tab
            Next
            s &= Environment.NewLine
        Next

        MessageBox.Show(s)
 
Thank you RiverGuy - That totally worked. It atleast shows my array and that it is not populating the way I want. But that's Good. I can see the results!!! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top