# Read array to call function

**URL:** <https://forum.kirupa.com/t/read-array-to-call-function/315304>\
**Category:** Uncategorized\
**Created:** [October 22, 2010, 2:19pm UTC](https://forum.kirupa.com/t/read-array-to-call-function/315304 "2010-10-22T14:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)\
**Post date:** [October 22, 2010, 2:19pm UTC](https://forum.kirupa.com/t/read-array-to-call-function/315304/1 "2010-10-22T14:19:09Z")

</div>

besides the fact that this does not work, how else would you go about doing something like this the most efficient way?  
thanks-

1)using the number keypad, the user pushes a series of numbers to an array.  
2)lookup() is called to identify which “code” has been entered.

```auto

myArray:Array= new Array(1,2,3,4);
lookup();

function lookup()
{
    switch (myArray)
    {
        case (1,2,3) :
            //do stuff
            break;

        case (1,2,3,4) :
            //do stuff
            break;

        default :
            break;
    }
}

```
