title: how to get this code working with loadStrings();?
body: <p>I would like to get this code working with loadStrings();</p>
  
  <p>Now the code loads the text through <em>String string =</em>, I would like to change that, in order to make it read a .txt file. </p>
  
  <p>I've tried various ways, but I always seem to get an error code. Is it possible?</p>
  
  <pre><code>PFont font;
  String string = "Processing is an open source programming language and environment for people who want to program images, animation, and interactions.";
  int fontSize = 10;
  int specificWidth = 150;
  int lineSpacing = 2;
  
  int textHeight;
  
  void setup() {
    size(600,600);
    background(0);
  
    font = createFont("Times New Roman", fontSize);
    textFont(font,fontSize);
    noLoop();
  }
  
  void draw() {
    fill(60);
    stroke(60);
    rect(100,100,specificWidth, calculateTextHeight(string, specificWidth, fontSize, lineSpacing));
    fill(255);
    text(string, 100,100,specificWidth,1000);
  }
  
  int calculateTextHeight(String string, int specificWidth, int fontSize, int lineSpacing) {
    String[] wordsArray;
    String tempString = "";
    int numLines = 0;
    float textHeight;
  
    wordsArray = split(string, " ");
  
    for (int i=0; i &lt; wordsArray.length; i++) {
      if (textWidth(tempString + wordsArray[i]) &lt; specificWidth) {
   tempString += wordsArray[i] + " ";
      }
      else {
   tempString = wordsArray[i] + " ";
   numLines++;
      }
    }
  
    numLines++; //adds the last line
  
    textHeight = numLines * (textDescent() + textAscent() + lineSpacing);
    return(round(textHeight));
  } 
  </code></pre>