# Changing a parameter within border command

**URL:** <https://community.freefem.org/t/changing-a-parameter-within-border-command/1749>\
**Category:** General Discussion\
**Created:** [May 16, 2022, 9:01pm UTC](https://community.freefem.org/t/changing-a-parameter-within-border-command/1749 "2022-05-16T21:01:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amtravco](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@amtravco](https://community.freefem.org/u/amtravco)\
**Post date:** [May 16, 2022, 9:01pm UTC](https://community.freefem.org/t/changing-a-parameter-within-border-command/1749/1 "2022-05-16T21:01:32Z")

</div>

Suppose I create a border using

```auto
real a = 1;
border b1(t=0,1){x=a*t;y=t;}

```

Then I create a second border using the identical code, but with variable _a_ changed:

```auto
a = 2;
border b2(t=0,1){x=a*t;y=t;}

```

These two borders are actually identical, because when they’re invoked (for instance, in plot or buildmesh), they use the current value of the variable _a_.

Is there a way to overcome this behavior, so that the two borders would actually end up being different?

(I’m trying to write a long border made up of many line segments for which it would be much easier if, before each border segment definition, I could define variable x0, y0, x1, y1 that are the endpoints of the border. But because of the above behavior, all borders use the final values of x0, y0, x1, y1, not the ones set just before border definition.)

---

<div class="post-metadata">

**Author:** ![amtravco](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@amtravco](https://community.freefem.org/u/amtravco)\
**Post date:** [May 16, 2022, 11:20pm UTC](https://community.freefem.org/t/changing-a-parameter-within-border-command/1749/2 "2022-05-16T23:20:17Z")

</div>

I’m not sure if what I asked is possible, but in the end I found an example (under “mesh building with array of border” in the help file) that shows essentially how to do what I needed: make a border from a list of vertex points.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [May 17, 2022, 1:05pm UTC](https://community.freefem.org/t/changing-a-parameter-within-border-command/1749/3 "2022-05-17T13:05:49Z")

</div>

Yes , it is impossible because the value of “a” is taken at time when you build the mesh.
