
244 Chapter 6 • Advanced Programming Concepts
6 Private LinesCounted As Integer = 0
7 Public Event Status(ByVal LinesCounted As Integer)
8 Public Event FinishedConverting()
9 Sub ToUpper(ByVal InFile As String, ByVal OutFile As String)
' first handle files
10 Dim inf As New SYSTEM.IO.File(InFile)
11 Dim outf As New SYSTEM.IO.File(OutFile)
' create streams for input and output
12 Dim myInstream As SYSTEM.IO.StreamReader
13 Dim myOutstream As SYSTEM.IO.StreamWriter
' temporary string to hold work
14 Dim mystr As String = " " ' initialize to not empty
15 Dim OutStr As String = " "
16 Try
17 myInstream = inf.OpenText ' Open a new stream for input.
' Do until the ...