Welcome to Dream.In.Code
Become a VB Expert!

Join 137,271 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,457 people online right now. Registration is fast and FREE... Join Now!




searching for equivalent in txtFile and display in lstBOX

 
Reply to this topicStart new topic

searching for equivalent in txtFile and display in lstBOX, help programming project please !

juansanmartin189
25 Nov, 2006 - 05:01 PM
Post #1

New D.I.C Head
*

Joined: 25 Nov, 2006
Posts: 1


My Contributions
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

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 08:01PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month