# Stuck on simple array problem!

**URL:** https://forum.kirupa.com/t/stuck-on-simple-array-problem/297787
**Category:** Uncategorized
**Created:** [October 8, 2009, 1:15pm UTC](https://forum.kirupa.com/t/stuck-on-simple-array-problem/297787 "2009-10-08T13:15:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sybot](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@sybot](https://forum.kirupa.com/u/sybot)
#### Post date: [October 8, 2009, 1:15pm UTC](https://forum.kirupa.com/t/stuck-on-simple-array-problem/297787/1 "2009-10-08T13:15:21Z")

</div>

Rite guys I’m hoping this will be relatively straightforward lol

Here is my array, its pretty simple

var goForw = new Array(15);  
for (var i = 0; i\<=goForw.length-1; i++) {

```
    if (locate == i){
        i=i+1
    }

```

}

This checks to see if the variable ‘i’ is equal to a number between 1 and 15, then once the number is equal, it adds to itself by 1

now… heres where I’m running into a snag, I want to call a function based on the result of the added number…

for example,

if (locate == 1){  
call function ‘question2’ [COLOR=Gray]\<-- question[i+1][/COLOR]  
}

so my initial value ‘locate’ is added to by 1, then i want to put that array number at the end of a function and call it… (there are 15 questions and 15 functions already created, so if the question is called it calls a function to play the next one)

so my question is… what should the syntax be to call this?

questioni+1; [COLOR=Gray]for example??[/COLOR]

does that make sense?  
I don’t think this would be a hard task… maybe it is? I just can’t seem to figure it out

thanks for any help  
Sy
