Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- 'Parse quest.txt
- Dim i = 0, j
- Using Reader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\Users\user\source\repos\quest.txt")
- Reader.TextFieldType = FileIO.FieldType.Delimited
- Reader.SetDelimiters("|")
- Dim values(Reader.LineNumber, 2)
- Dim currentLine As String()
- While Not Reader.EndOfData
- Try
- currentLine = Reader.ReadFields()
- j = -1
- Dim entry As String
- For Each entry In currentLine
- values(i, ++j) = entry
- Next
- 'Endline
- i += 1
- Catch ex As Microsoft.VisualBasic.
- FileIO.MalformedLineException
- MsgBox("Line " & ex.Message &
- "is not valid and will be skipped.")
- End Try
- End While
- End Using
- End Sub
- End Class
- ' Question syntax
- ' Question|answers separated with spaces
- ' --after every answer, answer image must be placed inside brackets [],
- ' --if no image Is wanted then don't place brackets
- 'example 1:
- ' |Ναι[y.png] Όχι[n.png]|Απογοητεύεσαι εύκολα;
- '
- ' example 2:
- ' |Άσπρο Μαύρο Μπλέ[blue.png]|Ποιό χρώμα σου αρέσει;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement