CODE
Option Strict On
'juan san martin
'11/19/06
Public Class frmTranslator
#Region "User Declared Subs"
'private sub
'End Sub
#End Region
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'closes program
End
End Sub
Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click
'DECLARE VARIABLE
Dim Infile As System.IO.StreamReader = System.IO.File.OpenText("ENGLISHTRANS.TXT") 'file declared and opened
Dim strEnglish(15) As String
Dim strFrench(15) As String
Dim strGerman(15) As String
Dim strSearchWord As String = txtEnglish.Text
Dim intCounter As Integer = 0
Dim blnFound As Boolean = False
Dim intWhere As Integer = -1
Dim intStart As Integer = 0
'INPUT
Do While Infile.Peek <> -1 'read until the end of file
strEnglish(intCounter) = Infile.ReadLine
strFrench(intCounter) = Infile.ReadLine
strGerman(intCounter) = Infile.ReadLine
intCounter += 1
Loop
Infile.Close()
'PROCESS
intStart = intWhere + 1
strEnglish(intCounter) = strSearchWord.Substring(intStart, intWhere)
Do While Not blnFound And intCounter <= UBound(strFrench)
If strSearchWord = strFrench(intCounter) Then
blnFound = True
Else
intCounter += 1
End If
Loop
'OUTPUT
End Sub
End Class