# Declaring an array of points

**URL:** <https://forum.universal-robots.com/t/declaring-an-array-of-points/2051>\
**Category:** URScript\
**Created:** [May 31, 2018, 7:47am UTC](https://forum.universal-robots.com/t/declaring-an-array-of-points/2051 "2018-05-31T07:47:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon9454352](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@anon9454352](https://forum.universal-robots.com/u/anon9454352)\
**Post date:** [May 31, 2018, 7:47am UTC](https://forum.universal-robots.com/t/declaring-an-array-of-points/2051/1 "2018-05-31T07:47:03Z")

</div>

How can I declare the array of points? I trying to do something like this, but it is not working

```
 A_var:=[0, 0, 0, 0, 0, 0]
 B_var:=[0, 0, 0, 0, 0, 0]
 C_var:=[0, 0, 0, 0, 0, 0]
 points≔[A_var, B_var, C_var]
 j≔0
 Wait: 0.7
 Loop j<i
   movel(points[j],0.6,0.02)
   j≔j+1

```

But four line of this programm is yellow. What I did wrong?

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [May 31, 2018, 7:57am UTC](https://forum.universal-robots.com/t/declaring-an-array-of-points/2051/2 "2018-05-31T07:57:28Z")

</div>

Arrays in URScript can only be 1D, and since JointPositions are literally a list (/array) as well, this is not possible.  
You could either append the lists;

```auto
points = [A_var[0], A_var[1], A_var[2], ... , C_var[5]]

```

And then use an additional offset, to extract the 6 joint positions, when needed.  
However a Pose is not a list, so if you need poses, this would work;

```auto
pose1 = p[x,y,z,rx,ry,rz]
pose2 = p[x,y,z,rx,ry,rz]
poses = [pose1, pose2]
movel(poses[0], a, v)

```

---

<div class="post-metadata">

**Author:** ![nlepage](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@nlepage](https://forum.universal-robots.com/u/nlepage)\
**Post date:** [September 16, 2022, 7:51pm UTC](https://forum.universal-robots.com/t/declaring-an-array-of-points/2051/3 "2022-09-16T19:51:48Z")

</div>

> [@jbm](#):
>
> `points = [A_var[0], A_var[1], A_var[2], ... , C_var[5]]`

Hi,  
I tried something similar to  
points = [A\_var[0], A\_var[1], A\_var[2], … , C\_var[5]]  
but the software will not allow it (it is in red). Are you sure it does work?  
If we put multiple poses what is the maximum size of a linear array? Each pose will take 6 elements…
