IDK what just happen, but when the program is still running, the text the after it showed it gone, or it just showed one text. can u guys help me sorry for my bad English, I'll be appreciated your help thank you so much this is my code
int j;
float timeinterval;
float lasttimecheck;
float endY = 0;
int index = 0;
int x2;
int y2;
int x0=150;
int y0=0;
float r = random(1, 20);
float x1 = 1;
float y1 = 1;
String[] words;
void timecapture() {
  lasttimecheck = millis();
  timeinterval = 0; //2sec
}
void setup() {
  size (400, 400);
  timecapture();
  frameRate(5);
   stroke(0);
}
void draw() { 
  background(255);
  textSize(20);
  int y2 = 0; 
  float [] x = new float [j];
  float [] y = new float [j];
  for (int i = 0; (i<x.length) && (i<y.length); i++ ) {
    x[i] = x1;
    y[i] = y1;
    fill(0);
    //text (x[i]+","+y[i], 20, y1);
  }
  y2 = y2+40;
  String[] data = new String[x.length];
  for (int ii = 0; ii<x.length; ii++) {
    data [ii] = str(x[ii]) + ("\t") + str(y[ii]);
  }
  if (millis() > lasttimecheck + timeinterval) {
    saveStrings("location", data);
    lasttimecheck = millis();
  }
    if (x.length<30 && y.length<30)
    j=j+1;
    x1=x1+r; y1=y1+r; 
 }
 
                        
The issue is that the arrays
xandyare recreated in every frame.Add global variables
x,yanddata. Useappend()to add values to the arrays. And draw the text in a loop: