# For statement not passing "i" variable to onPress inside of it

**URL:** <https://forum.kirupa.com/t/for-statement-not-passing-i-variable-to-onpress-inside-of-it/180051>\
**Category:** Uncategorized\
**Created:** [February 25, 2006, 1:20am UTC](https://forum.kirupa.com/t/for-statement-not-passing-i-variable-to-onpress-inside-of-it/180051 "2006-02-25T01:20:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lejon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lejon/32/2181_2.png) [@lejon](https://forum.kirupa.com/u/lejon)\
**Post date:** [February 25, 2006, 1:20am UTC](https://forum.kirupa.com/t/for-statement-not-passing-i-variable-to-onpress-inside-of-it/180051/1 "2006-02-25T01:20:26Z")

</div>

How do i go about doing this? I just have a generic loop say from 0 to 6 that I would like to “capture” this number and have it passed to the onPress statement within the for loop.
