Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Working with text files and program's data

$
0
0
I'm writting like a dictionary where I save in a *.txt file all the information I need to show the words and translations.
At the moment, the txt file has the next configuration:
russian_word||spanish_word

So the program read all the text before || to select the english word, and after || to select the french word.

Code:

        Dim TextoRuso As String
        Dim TextoEspanol As String
        Dim Muestra As String

        Muestra = arrText(ContadorPalabras)

        For i = 1 To Muestra.Length
            If (Mid(Muestra, i, 1)) <> "|" Then
                TextoRuso = TextoRuso & Mid(Muestra, i, 1)
            Else
                Exit For
            End If
        Next

        For r = 1 To Muestra.Length
            If (Mid(Muestra, r, 2)) = "||" Then
                TextoEspanol = Mid(Muestra, (r + 2), (Muestra.Length - (r - 2)))
            Else
                'Exit For
            End If
        Next

        Label_Ruso.Text = TextoRuso
        Label_Espanol.Text = TextoEspanol

        If ContadorPalabras < NumeroLineas Then ContadorPalabras = ContadorPalabras + 1
        If ContadorPalabras = NumeroLineas Then Boton_Siguiente.Enabled = False


        TextoRuso = ""
        Boton_Anterior.Enabled = True

At the moment, in other form I'm trying to rank the words from 1(the worse) to 3(the better). For that task I click on number 1 or 2 or 3 and I want that at the end of that line (that corresponds to a specific word) appears 1, 2, or 3 stars.
example
Table||Mesa//***
Where: english_word||spanish_word//rate (I use russian, but this is an example)

Where I try to do the next:
Code:

Dim srWrite as new StreamWriter (filepath)
writer.WriteLine(data)

It seems that it doesn't work. So I have to approach that in another way?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>