# Storing Point in a variable

**URL:** <https://discourse.processing.org/t/storing-point-in-a-variable/17381>\
**Category:** Beginners\
**Created:** [January 27, 2020, 7:01pm UTC](https://discourse.processing.org/t/storing-point-in-a-variable/17381 "2020-01-27T19:01:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prathmesh](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@prathmesh](https://discourse.processing.org/u/prathmesh)\
**Post date:** [January 27, 2020, 7:01pm UTC](https://discourse.processing.org/t/storing-point-in-a-variable/17381/1 "2020-01-27T19:01:07Z")

</div>

Hello All,  
Why is the statement below invalid:  
float x = point(a,b);  
it gives me the error : void cannot be matched with int.(interesting!!) Is it not possible to store a point in a variable? I came across this while trying to generate a group of points using “for” loop and then trying to save them in an array.

 ![Capture](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/611f63a4a125817bee869be09dea3665f09a5635.jpeg)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 27, 2020, 7:48pm UTC](https://discourse.processing.org/t/storing-point-in-a-variable/17381/2 "2020-01-27T19:48:32Z")

</div>

`point()` is there to draw a point

- For the data type to store x,y see PVector in the reference : [https://www.processing.org/reference/PVector.html](https://www.processing.org/reference/PVector.html)

both work also with x,y,z (in 3D). A vector is actually a quite complex mathematical thing, in processing an object that knows also commands.

(In future please post your code as text and not as an image)

Chrisir

```auto

PVector[] listPV = new PVector[0];

void setup() {
  size(999, 600);

  // fill listPV
  for (int i=20; i<480; i+= 20) {
    listPV = (PVector[]) append(listPV, new PVector(i, height/2));
  }//for

  // Show listPV
  for (PVector pv : listPV) {
    println (pv);
  }//for 
}//func 

void draw() {
  //
}//func 

```

---

<div class="post-metadata">

**Author:** ![trikaphundo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/trikaphundo/32/7913_2.png) [@trikaphundo](https://discourse.processing.org/u/trikaphundo)\
**Post date:** [January 27, 2020, 9:26pm UTC](https://discourse.processing.org/t/storing-point-in-a-variable/17381/3 "2020-01-27T21:26:13Z")

</div>

Hello @prathmesh, remember that you can always go straight to a function’s description in the Processing’s reference just by doing this on the Sketchbook:

1. Highlight the function’s name (for instance double click the name).
2. Open the context menu by right clicking on the function’s name.
3. Click on “Find in reference”.
