Can somebody tell me what line i get this error " Argument 'Prompt' cannot be converted to type 'string' "

Try
            If movieTxt.Text <> Nothing And ratingCmb.SelectedIndex <> 0 Then
                For a = 0 To i
                    newItem.SubItems.Add(movieArray(a))
                    ListView1.Items.Add(ratingArray(a))
                    '// add Item to ListView.
                    movieTxt.Clear()
                    ratingCmb.SelectedIndex = 0

                    warnNoMovie.Text = ""
                    warnNoRating.Text = ""

                    MsgBox(movieArray)
                Next
                i += 1
            End If
        Catch err As Exception
            MsgBox(err.Message)
        End Try

Thank you in advance.

Recommended Answers

Seems that line 13 is causing the error since it probably is an Array and you need to have an index for which Array to get the value from, not the entire Array.

Try this:

MsgBox(movieArray(a))
Jump to Post

All 3 Replies

Seems that line 13 is causing the error since it probably is an Array and you need to have an index for which Array to get the value from, not the entire Array.

Try this:

MsgBox(movieArray(a))
commented: Great help. +3

Is there a way on how to display the arrays that is stored in?

but thanks anyway.

See if this helps.

Dim arMovies() As String = {"Rise of the Planet of the Apes (2011)", "Mr. Popper's Penguins (2011)", "X-Men: First Class (2011)"} '// for testing.
        For Each itm As String In arMovies
            MsgBox(itm)
        Next
        '//------ OR...
        For i As Integer = 0 To arMovies.Length - 1
            MsgBox(arMovies(i))
        Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.