Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

VS 2012 Syntax Error

$
0
0
I'm writing a text file based quiz. Importing the questions into my 2D array's headers and the questions lay under them in the rows.

I'm getting an error here:
Code:

Case Is QuizArray(0, 0)
Stating: "Relational operator expected"

However when I add an "=" stating option strict disallows type Object for operator and to use "Is" instead. Leading me into an infinite loop of errors.

Does anyone see a better way to do this?


vb.net Code:
  1. Private Sub lstQuestions_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstQuestions.SelectedIndexChanged
  2.         Select Case lstQuestions.SelectedItem
  3.             Case Is QuizArray(0, 0)
  4.                 txtQuestion.Text = QuizArray(0, 0)
  5.                 txtAnswer1.Text = QuizArray(1, 0)
  6.                 txtAnswer1.Text = QuizArray(2, 0)
  7.                 txtAnswer1.Text = QuizArray(3, 0)
  8.                 txtAnswer1.Text = QuizArray(4, 0)
  9.  
  10.         End Select

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>