# Returning a value from a method

**URL:** <https://forum.servoy.com/t/returning-a-value-from-a-method/2650>\
**Category:** Classic Servoy\
**Created:** [September 6, 2004, 2:55pm UTC](https://forum.servoy.com/t/returning-a-value-from-a-method/2650 "2004-09-06T14:55:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [September 6, 2004, 2:55pm UTC](https://forum.servoy.com/t/returning-a-value-from-a-method/2650/1 "2004-09-06T14:55:22Z")

</div>

Is there a way to return a value from a method – other than setting a global variable that the calling method can check?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [September 6, 2004, 3:23pm UTC](https://forum.servoy.com/t/returning-a-value-from-a-method/2650/2 "2004-09-06T15:23:21Z")

</div>

Returning a value when? When calling the method from another method?

Paul

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [September 6, 2004, 3:28pm UTC](https://forum.servoy.com/t/returning-a-value-from-a-method/2650/3 "2004-09-06T15:28:32Z")

</div>

this should be the way to go:

```auto
method.1:
var value = globals.method(othervalue, nextvalue);

globals.method:
var ov = arguments[0];
var nv = arguments[1]; //etc...

return ov+nv; //or whatever but this returns the new value

```

---

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [September 6, 2004, 3:59pm UTC](https://forum.servoy.com/t/returning-a-value-from-a-method/2650/4 "2004-09-06T15:59:09Z")

</div>

Right. Thanks.
