I am trying to create a while loop that ends when someone types ".".
My code is as follows and I get the error that follows the code:
Dim x, y As Integer
Dim stuff(x) As String
y = 1
x = 0
While y = 1
x = x + 1
Console.WriteLine("input stuff end with .")
stuff(x - 1) = Console.ReadLine()
If stuff(x - 1) = "." Then
y = 0
End If
End While
The error message:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in practise.exe
Additional information: Index was outside the bounds of the array.
Thanks in advance.