Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Where is your initialize function? Commented Mar 3, 2017 at 5:59
  • oh sorry.. i will add it... Commented Mar 3, 2017 at 8:20
  • have you tried to put a breakpoint to y=index to see if it ever got assigned a value? Also after being assigned you should break the loop or next one can reassign y to -1. Commented Mar 3, 2017 at 8:28