# Does func works on conditional clause?

**URL:** <https://community.freefem.org/t/does-func-works-on-conditional-clause/1934>\
**Category:** General Discussion\
**Created:** [August 7, 2022, 2:09pm UTC](https://community.freefem.org/t/does-func-works-on-conditional-clause/1934 "2022-08-07T14:09:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![larismartins](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/larismartins/32/2712_2.png) [@larismartins](https://community.freefem.org/u/larismartins)\
**Post date:** [August 7, 2022, 2:09pm UTC](https://community.freefem.org/t/does-func-works-on-conditional-clause/1934/1 "2022-08-07T14:09:29Z")

</div>

Hello,

I’m trying to do the following:

```auto
int phiOrder = getARGV("-phiO", 1);
int psiOrder = getARGV("-psiO", 1);

load "Element_P3"
load "Element_PkEdge"

//polinomial order edge
if(phiOrder == 0)
 func Pm = P0edge; 
if(phiOrder == 1)
 func Pm = P1edge; 

//polinomial order volume
if(psiOrder == 2)
 func Pk = P2;
else if(psiOrder == 3)
 func Pk = P3;

```

but I keep getting the following error:

```auto
The identifier Pm exists the existing type is <N5Fem2D8TypeOfFEE> 
the new type is <N5Fem2D8TypeOfFEE>

```

What am I doing wrong? Or this is not possible?

Best regards!

---

<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:** [August 8, 2022, 10:20am UTC](https://community.freefem.org/t/does-func-works-on-conditional-clause/1934/2 "2022-08-08T10:20:06Z")

</div>

It is not possible but macro generation you can do,

se example tutorial/Stokes-macro2d-3d.edp :

> <https://github.com/FreeFem/FreeFem-sources/blob/master/examples/tutorial/Stokes-macro2d-3d.edp>
