title: Error: cannot find symbol - Internal Search Engine
body: <p>I need to create an internal search engine that access a Server File, and looks through each text file for the keyword/phrase that the client needs. However, with the code I have so far i keep getting this error: </p>
  
  <blockquote>
    <p>SearchFunction.java:28: error: cannot find symbol</p>
  
  <pre><code>          } while (fileName == true); 
                     ^   symbol:   variable fileName   location: class SearchFunction
  </code></pre>
  </blockquote>
  
  <p>Any help at all would be awesome! Thanks!</p>
  
  <pre><code>public class SearchFunction{
      public static void main (String[] args){
  
          try{
              do {
                  int count = 1;
                  String fileName = "Buyerserver" + count + "Log.txt";
  
                  BufferedReader br = new BufferedReader(new FileReader (fileName));
  
                  int linecount = 0;
                      String line;
                  System.out.println("Searching for " + args[0] + " in file...");
  
                  while ((line = br.readLine()) != null)
                  {
                      linecount++;
                      int indexfound = line.indexOf(args[0]);
  
                      if (indexfound &gt; -1){
                          System.out.println("Word was found at positon " + indexfound + " on line " + linecount);
                          }
                      }
                      br.close();
                      count++;
                  } while (fileName == true); 
              } 
              catch (IOException e){
                  System.out.println("IO Error Occurred: " + e.toString());
              }
      }
  }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
  </code></pre>