But I try not to think with my gut. If I'm serious about understanding the world, thinking with anything besides my brain, as tempting as that might be, is likely to get me into trouble.
If the Word Bank is empty an Exception was thrown. Yes I forgot to test it. lol
If WordBank.Count > 0 Then
TxtWordHidden.Text = WordBank(WordNum).ToUpper
Else
If MessageBox.Show("There are no words in the Word Bank!" & vbNewLine &
"Do you want to add new words now?", "No Words Available",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) = DialogResult.Yes Then
Shell("Notepad.exe " & AppDomain.CurrentDomain.BaseDirectory & "WordBank.txt", AppWinStyle.NormalFocus)
BtnNewGame.Visible = True
Else
Close()
End If
End If
That's a great point Alex. Yes - "FileNotFoundException" which I have now fixed.
Dim Filename As String = AppDomain.CurrentDomain.BaseDirectory & "WordBank.txt"
If Not IO.File.Exists(Filename) Then
IO.File.Create(Filename).Close()
End If
Dim objFile As New IO.StreamReader(Filename)
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.