title: Read the values of variables from a TXT file in Processing
body: <p>I have the following program in Proccessing and I try to find a way to read the values ​​of variables from a TXT file. </p>
  
  <pre><code>static final int ribbon_length = 255, H = 200; 
  
  void setup() {
    size(ribbon_length, H); //Διαστάσεις παλέτας
  }
  
  void draw() {
    float p = 1;
    int up_y = 10;
    int widthh = 1;
    int height = 180;
    float a = pow (ribbon_length, 1-p);
    float colour = 0;
    for (int step = 0; step &lt;= 255; step++) { 
        colour = a * pow (step, p);
        fill(colour,0,0); 
        rect(widthh*step, up_y, widthh, height);
        noStroke();
     }
  }
  </code></pre>
  
  <p>The values tha I want to read from the txt is </p>
  
  <pre><code>  float p = 1; 
    int up_y = 10; 
    int widthh = 1;
    int height = 180;
  </code></pre>
  
  <p>I found <a href="http://www.processing.org/reference/BufferedReader.html" rel="nofollow">BufferedReader</a> command but I'm not sure if it is thaτ I want. I try ρθν an example..but it didn't work...</p>
  
  <pre><code>BufferedReader reader;
  String line;
  static final int ribbon_length = 255, H = 200;
  
  void setup() {
    size(ribbon_length, H);
    reader = createReader("positions.txt");  
  }
  .
  .
  .
  .
  </code></pre>
  
  <p>Any ideas????</p>
  
  <p><strong>EDIT:</strong>
  Thanks for your answers. 
  I try some changes after your commends. But It didn't show any color.</p>
  
  <pre><code>static final int ribbon_length = 255, H = 200; 
  
  void setup() {
    size(ribbon_length, H);
  }
  
  void draw() {
    String[] lines = loadStrings("input.txt");
    float p = float(split(lines[0], "=")[1]);
    int up_y = int(split(lines[1], "=")[1]);
    int wide = int(split(lines[2], "=")[1]);
    int high = int(split(lines[3], "=")[1]);
    float a = pow (ribbon_length, 1-p);
    float colour = 0;
    for (int step = 0; step &lt;= 255; step++) { 
        colour = a * pow (step, p);
        fill(colour,0,0); 
        rect(wide*step, up_y, wide, high);
        noStroke();
     }
  }
  </code></pre>