Run On Sentence Needs Breaking Up

var apple = {
employees:400,
locale: { state:“California”,
town:“Palo Alto” },
revenues:1000000
};
fill(100,200,90);
textSize(30);
text("Apple has " + apple.employees + " people working at " + apple.locale.town + “,” + apple.locale.state + " generating revenues of " + apple.revenues + “.”,0,30);


The above code does do what I wanted it to - namely generate the sentence -
Apple has 400 people working at Palo Alto, California, generating revenues of 1000000. -
but the entire sentence is one long line and thus runs off the page. How can I break it up into smaller segments that will display the entire sentence on the page?

The first two numbers in the text() call after the text are the text position. You can also specify the text size (width and height) with two more numbers after that. By giving the text a specific width you can cause the text to wrap within that width

text("Apple has " + apple.employees + " people working at " + apple.locale.town + "," + apple.locale.state +
  " generating revenues of " + apple.revenues + ".",0,30,300,400);

You can also leave off the height so it can grow vertically as far as it needs to (until it runs out of screen)

text("Apple has " + apple.employees + " people working at " + apple.locale.town + "," + apple.locale.state +
  " generating revenues of " + apple.revenues + ".",0,30,300);

Thanks for pointing that out - I didn’t know that those extra 2 parameters were available nor how they could be used to fix the situation that I had described -
as I stated in the enclosed graphic though, adding the width parameter alone, is not enough but no matter - we got the problem solved and that’s the main thing