daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Apr 25th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  3.  
  4.         'Parse quest.txt
  5.         Dim i = 0, j
  6.         Using Reader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\Users\user\source\repos\quest.txt")
  7.             Reader.TextFieldType = FileIO.FieldType.Delimited
  8.             Reader.SetDelimiters("|")
  9.             Dim values(Reader.LineNumber, 2)
  10.             Dim currentLine As String()
  11.             While Not Reader.EndOfData
  12.                 Try
  13.                     currentLine = Reader.ReadFields()
  14.                     j = -1
  15.                     Dim entry As String
  16.                     For Each entry In currentLine
  17.                         values(i, ++j) = entry
  18.                     Next
  19.                     'Endline
  20.                     i += 1
  21.  
  22.  
  23.  
  24.                 Catch ex As Microsoft.VisualBasic.
  25.                      FileIO.MalformedLineException
  26.                     MsgBox("Line " & ex.Message &
  27.            "is not valid and will be skipped.")
  28.                 End Try
  29.             End While
  30.         End Using
  31.  
  32.     End Sub
  33. End Class
  34.  
  35. ' Question syntax
  36. ' Question|answers separated with spaces
  37. ' --after every answer, answer image must be placed inside brackets [],
  38. ' --if no image Is wanted then don't place brackets
  39. 'example 1:
  40. ' |Ναι[y.png] Όχι[n.png]|Απογοητεύεσαι εύκολα;
  41. '
  42. ' example 2:
  43. ' |Άσπρο Μαύρο Μπλέ[blue.png]|Ποιό χρώμα σου αρέσει;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top