# What does this error mean?

**URL:** https://discourse.processing.org/t/what-does-this-error-mean/15794
**Category:** Beginners
**Created:** [November 25, 2019, 12:14pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794 "2019-11-25T12:14:51Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 25, 2019, 12:14pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/1 "2019-11-25T12:14:51Z")

</div>

Hello! I am making a bar graph program and I need to get some numbers in an array.  
But an error pops out and I don’t get what it means. Can anybody tell me what this error is and what I have to do in order to fix it?  
Thank you.

//

```auto
void setup(){
  background(0);
  size(1000, 1000);
  textSize(30);
  text("*GraphSaver Beta Instructions*\n\nPress the white button on the right top to end program.\n\n1.First enter the title.\n2.Then enter the number of rows.\n3.Then enter all of your data.\n4.A graph will be made.press enter to save and delete to erase it. \n\nWhen you finish reading click the screen.", 20, 30);
}

int num=0;
String title = "";
IntList arr;

void draw(){
  //text("*Instructions*\n\nPress the white button on the right top to end program.\n\n1.First enter the number of rows.\n2.Then enter the title.\n3.Then enter all of your data.\n4.A graph will be made. press enter to save and delete to erase it. ", 10, 10);
  square(950, 0, 50);
  
  textSize(30);
  if(keynum==0)text(title, 100, 100);
  if(keynum==1 && num != 0)text(num-48, 100, 100);
  if(keynum==2 && imsi-1 == num)for(int i = 0; i <= arr.size(); i++)text(arr.get(i), 100, 100);
}

void mousePressed(){//End process
  background(0);
  if(mouseX > 950 && mouseY < 50){
    fill(200, 11, 22);
    square(950, 0, 50);
    delay(5000);
    print("END");
  }
}

void mouseMoved(){
  if(mouseX > 950 && mouseY < 50){
    fill(200, 11, 22);
    square(950, 0, 50);
  }
  else {
    fill(255);
    square(950, 0, 50);
  }
}

int imsi=0;//temp
int keynum=0;//how nany times key has been pressed-0:title, 1: number of rows, 2 : data

void keyPressed(){//input
  background(0);
  if(key == ENTER){keynum++;return;}
  if(keynum == 0)title += key;
  if(keynum == 1){
    num = key;
  }
  if(keynum == 2){
    arr.append(key);
    imsi++;
  }
}

```

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 25, 2019, 12:25pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/2 "2019-11-25T12:25:22Z")

</div>

please format your code posting  
by paste it into the

```auto
</> code button

```

of the editor header menu ( context name: Preformatted text )  
looks like  
```  
type or paste code here  
```

also can use the  
```  
manually above and below your code.

* * *

somehow i not see where and what error you get??

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 25, 2019, 12:43pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/3 "2019-11-25T12:43:36Z")

</div>

Oh. I was just stupid enough to not write the arr = new IntList(); part. Still, thank you.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 25, 2019, 1:08pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/4 "2019-11-25T13:08:06Z")

</div>

try a

```auto
  if (keynum == 2) {
    arr.append(key);
    imsi++;
    println(arr);
  }

```

to understand about your next problem

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 25, 2019, 1:11pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/5 "2019-11-25T13:11:06Z")

</div>

Um, I guess the space bars are also being put into the arr?  
Plus, strange numbers keep popping up but I don’t know why.  
Please help me.

```auto

void setup(){
  background(0);
  size(1000, 1000);
  textSize(30);
  text("*GraphSaver Beta Instructions*\n\nPress the white button on the right top to end program.\n\n1.First enter the title.\n2.Then enter the number of rows.\n3.Then enter all of your data.\n4.A graph will be made.press enter to save and delete to erase it. \n\nWhen you finish reading click the screen.", 20, 30);
  arr = new IntList();
}

int num=0;
String title = "";
IntList arr;

void draw(){
  square(950, 0, 50);
  
  textSize(30);
  if(keynum==0)text(title, 100, 100);
  if(keynum==1 && num != 0){
    text(num-48, 100, 100);
    num -= 48;
  }
  if(keynum==2){
    for(int i = 0; i < arr.size(); i++){
      arr.sub(i, 48);
      text(arr.get(i), 100, 100);
    }
  }

}

void mousePressed(){//End process
  background(0);
  if(mouseX > 950 && mouseY < 50){
    fill(200, 11, 22);
    square(950, 0, 50);
    delay(5000);
    print("END");
  }
}

void mouseMoved(){
  if(mouseX > 950 && mouseY < 50){
    fill(200, 11, 22);
    square(950, 0, 50);
  }
  else {
    fill(255);
    square(950, 0, 50);
  }
}

int imsi=0;//temp
int keynum=0;//how nany times key has been pressed-0:title, 1: number of rows, 2 : data

void keyPressed(){//input
  background(0);
  if(key == ENTER){keynum++;return;}
  if(keynum == 0)title += key;
  if(keynum == 1){
    num = key;
  }
 if (keynum == 2) {
    arr.append(key);
    imsi++;
    println(arr);
  }
}

```

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 25, 2019, 1:13pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/6 "2019-11-25T13:13:55Z")

</div>

check some lines above how you do the title,  
add keys to a string and on ENTER use that,  
same here, just the resulting string of numbers you need to convert to number,  
that can put into the intList  
( IF YOU NEED NUMBERS \> 0 … 9 )

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 25, 2019, 1:15pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/7 "2019-11-25T13:15:31Z")

</div>

Umm, sorry but I don’t understand… So am I supposed to get the enter like  
get int, get char(space bar)…?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 25, 2019, 1:18pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/8 "2019-11-25T13:18:18Z")

</div>

it is your program,  
but i would expect that the first of X number typed be like  
1234[ENTER]  
so you must catch a string “1234”  
and convert to number 1234  
and append to intList?  
sorry if i understand wrong what you try to do

* * *

yes, while you collect the string must check on each key if it is a number…  
or the convert will fail ? possibly defaults to ‘0’

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 25, 2019, 1:19pm UTC](https://discourse.processing.org/t/what-does-this-error-mean/15794/9 "2019-11-25T13:19:01Z")

</div>

## Aha so I should get it without space! Thank you.

I think my code is really full of mistakes. It will take a century fixing this code.  
Maybe I should just go to bed right now and think about it tomorrow.  
Thank you for your kind explanation^^
