# How to execute a string as a function

**URL:** <https://forum.kirupa.com/t/how-to-execute-a-string-as-a-function/155856>\
**Category:** Uncategorized\
**Created:** [July 20, 2005, 9:08pm UTC](https://forum.kirupa.com/t/how-to-execute-a-string-as-a-function/155856 "2005-07-20T21:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![serkios](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/serkios/32/608_2.png) [@serkios](https://forum.kirupa.com/u/serkios)\
**Post date:** [July 20, 2005, 9:08pm UTC](https://forum.kirupa.com/t/how-to-execute-a-string-as-a-function/155856/1 "2005-07-20T21:08:01Z")

</div>

Hi, I’m trying to make a function that can take a string formatted as a function command and execute it.  
For example I want to take

```auto
 var myString:String = "runFunction(var1, var2, var3);"

```

and then execute that string as a function. I’ve tried

```auto
eval(myString);

```

and didnt seem to work. Anyone have ideas on how I can accomplish this? Thanks-
