# Variable function calling (Another Way)

**URL:** <https://forum.inductiveautomation.com/t/variable-function-calling-another-way/8288>\
**Category:** Ignition\
**Created:** [April 9, 2014, 5:01pm UTC](https://forum.inductiveautomation.com/t/variable-function-calling-another-way/8288 "2014-04-09T17:01:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [April 9, 2014, 5:01pm UTC](https://forum.inductiveautomation.com/t/variable-function-calling-another-way/8288/1 "2014-04-09T17:01:49Z")

</div>

I just wrote the following post in response to the topic [variable function calling](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=12118) but then it was locked so I’m posting my solution here:

```auto
number = 2
setattr(app.testModule,"value%s"% number, 4)
```

To make this a little easier you could put this function in app.testModule:

```auto
def setValue(number,value):
	import app
	setattr(app.testModule,"value%s"% number, value)
```

Then you could use:

```auto
number = 2
app.testModule.setValue(number, 4)
```
