# Pass a variable to function with changing the variable (byRef)

**URL:** <https://forum.kirupa.com/t/pass-a-variable-to-function-with-changing-the-variable-byref/332599>\
**Category:** Uncategorized\
**Created:** [August 10, 2014, 4:45pm UTC](https://forum.kirupa.com/t/pass-a-variable-to-function-with-changing-the-variable-byref/332599 "2014-08-10T16:45:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrhartsclube](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@mrhartsclube](https://forum.kirupa.com/u/mrhartsclube)\
**Post date:** [August 10, 2014, 4:45pm UTC](https://forum.kirupa.com/t/pass-a-variable-to-function-with-changing-the-variable-byref/332599/1 "2014-08-10T16:45:32Z")

</div>

hey guys  
i want to solve this question (is a part of my function):

```auto

[COLOR=#808080]// root of my frame[/COLOR]
[COLOR=#0000ff]var [/COLOR]no = 0;
[COLOR=#800080]function [/COLOR]numberIncrease (num:[COLOR=#0000ff]Number[/COLOR])[INDENT]{[/INDENT]
[INDENT=2]num++;
[/INDENT]
[INDENT]}
[/INDENT]
[COLOR=#808080]// in a button[/COLOR]
[COLOR=#800080]on [/COLOR]([COLOR=#0000ff]release[/COLOR])[INDENT]{[/INDENT]
[INDENT=2]numberIncrease(no);
[/INDENT]
[INDENT]}

```

[/INDENT]

the question is why “ **no** ” remains unchanged and how to fix it without replacing “ **num++** ” with “ **no++** ”. thanks
