Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't really know VB very well (C#/C++ for me) but to help you out here is a basic little program to get you started. I am sure this isn't the most efficient way, as every bit of this was thrown together just by searching the internet on how to do things. But it will get you going in the right direction. If you need to write to a file you can look up StreamWriter and there will be tons of stuff there for you, can't do it all for ya :)</p> <pre><code>Sub Main() 'this is the first part for you Dim szBirthDate As String Console.WriteLine("Please enter your birthdate (MM-DD-YY) ""Enter""to finish:") szBirthDate = Console.ReadLine() Dim szInputtedDateArray As Array Dim szYear As String szInputtedDateArray = szBirthDate.Split("-") szYear = "19" &amp; szInputtedDateArray(2).ToString() 'at this point the szYear variable has the year format from your final.txt file 'now read the file until you find your year Try ' Create an instance of StreamReader to read from a file. Dim sr As System.IO.StreamReader = New System.IO.StreamReader("C:\appdev\final.txt") Dim line As String Dim cnt As Integer cnt = 0 ' Read the file until you find the year you need or the end of the file is reached. Do cnt += 1 line = sr.ReadLine() line = line.Trim() If line.IndexOf(szYear, 0, 4) &gt; -1 Then Console.WriteLine("In " + szYear.ToString() + " the best seller was " + line.Substring(5)) Console.WriteLine(cnt.ToString() + " items searched") Exit Do End If Loop Until line Is Nothing sr.Close() Catch E As Exception ' Let the user know what went wrong. Console.WriteLine("The file could not be read:") Console.WriteLine(E.Message) End Try End Sub </code></pre> <p>As I said above, I'm not a VB guy so this may be crude but it works, familiarize yourself with it and you remember the internet is your friend.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload