# Calling a function within a function

**URL:** <https://forum.inductiveautomation.com/t/calling-a-function-within-a-function/11140>\
**Category:** General Discussion\
**Created:** [January 29, 2016, 1:01am UTC](https://forum.inductiveautomation.com/t/calling-a-function-within-a-function/11140 "2016-01-29T01:01:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [January 29, 2016, 1:01am UTC](https://forum.inductiveautomation.com/t/calling-a-function-within-a-function/11140/1 "2016-01-29T01:01:06Z")

</div>

Okay here’s my sample code :

[code]def read\_parameter():  
do something here

def parse\_parameter():  
read\_parameter()[/code]

and on a button I am calling `parse_parameter()
`But its giving me this error.

```auto
NameError: global name 'read_parameter' is not defined
```

---

<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:** [January 29, 2016, 9:30am UTC](https://forum.inductiveautomation.com/t/calling-a-function-within-a-function/11140/2 "2016-01-29T09:30:40Z")

</div>

You are using legacy scoping. You must use standard scoping to call functions this way.

You can find out more about standard/legacy scoping here: [perfectabstractions.com/blog … rd-scoping](http://www.perfectabstractions.com/blog/new-scripting-features-in-ignition-77-part-1#standard-scoping)

Best,
