# Function with multiple outputs?

**URL:** <https://community.freefem.org/t/function-with-multiple-outputs/436>\
**Category:** General Discussion\
**Created:** [May 28, 2020, 2:56pm UTC](https://community.freefem.org/t/function-with-multiple-outputs/436 "2020-05-28T14:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeniaminBogosel](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BeniaminBogosel](https://community.freefem.org/u/BeniaminBogosel)\
**Post date:** [May 28, 2020, 2:56pm UTC](https://community.freefem.org/t/function-with-multiple-outputs/436/1 "2020-05-28T14:56:08Z")

</div>

Is it possible to have functions in FreeFEM with multiple outputs? For example sometimes I need the function value, the gradient and the Hessian of some function defined with `func’. Is it possible to output them all, or the only option is to use global variables?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 28, 2020, 2:58pm UTC](https://community.freefem.org/t/function-with-multiple-outputs/436/2 "2020-05-28T14:58:44Z")

</div>

If you are talking about a FreeFEM `func`, then no, it can return only one value. If you are talking about a FreeFEM plugin with in/out parameters, then yes, you can return multiple values.

---

<div class="post-metadata">

**Author:** ![BeniaminBogosel](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BeniaminBogosel](https://community.freefem.org/u/BeniaminBogosel)\
**Post date:** [May 28, 2020, 3:11pm UTC](https://community.freefem.org/t/function-with-multiple-outputs/436/3 "2020-05-28T15:11:04Z")

</div>

Thank you for the answer. I use a FreeFEM `func`, so I guess there’s no avoiding using global variables.
