# Adding to an int on the press of a button

**URL:** <https://forum.inductiveautomation.com/t/adding-to-an-int-on-the-press-of-a-button/12610>\
**Category:** Ignition\
**Created:** [January 26, 2017, 6:58pm UTC](https://forum.inductiveautomation.com/t/adding-to-an-int-on-the-press-of-a-button/12610 "2017-01-26T18:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boster281](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@boster281](https://forum.inductiveautomation.com/u/boster281)\
**Post date:** [January 26, 2017, 6:58pm UTC](https://forum.inductiveautomation.com/t/adding-to-an-int-on-the-press-of-a-button/12610/1 "2017-01-26T18:58:05Z")

</div>

This maybe easy or on another post that i could find in my search, if so sorry.

I want to add 1 to an int when i press a button and the in is greater than 0 and less than 193

here is what i am trying.

[code]  
qv1 = system.tag.read(“Folder/Int”)

if qv1 \> 0 and qv1 \< 193:

```
system.tag.writeToTag('Folder/Int', qv1+1)[/code]
```

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [January 26, 2017, 8:28pm UTC](https://forum.inductiveautomation.com/t/adding-to-an-int-on-the-press-of-a-button/12610/2 "2017-01-26T20:28:51Z")

</div>

Hi there,

You are close. Try this:

[code]qv1 = system.tag.read(“Folder/Int”).value

if qv1 \> 0 and qv1 \< 193:

system.tag.writeToTag(‘Folder/Int’, qv1+1)[/code]Best,
