I keep getting two errors which are the _ in the code which was on the worksheet and I put that in.
Imports System.IO
Module Module1
Sub Main()
Dim inFile As StreamReader = File.OpenText("History.dat")
Dim inputString As String
Dim linecount As Integer
Dim blankCount As Integer
Dim index As Integer
Dim outFile As StreamWriter = File.CreateText("Data.out")
While (inFile.Peek <> -1)
inputString = inFile.ReadLine
linecount += 1
blankCount = 0
index = inputString.IndexOf(" ")
While (index <> -1)
blankCount += 1
If (inputString.Length <> 1) Then
inputString = inputString.Substring (index + 1, [COLOR="red"][B]_[/B][/COLOR] inputString.Length - (index +1))
index = inputString.IndexOf(" ")
Else
index = -1
End If
End While
outFile.WriteLine("Line" & linecount & "Contains" [COLOR="red"][B]_[/B][/COLOR] & blankCount & "blanks.")
End While
outFile.Close()
inFile.Close()
Console.WriteLine("Finished.")
Console.Write("Press Enter To Quit")
Console.Read()
End Sub
End Module
I get the two errors:
Identifier Unexpected
- Bondi


Sign In
Create Account

Back to top









