# Script question

**URL:** <https://forum.inductiveautomation.com/t/script-question/4050>\
**Category:** Ignition\
**Created:** [February 23, 2012, 12:52pm UTC](https://forum.inductiveautomation.com/t/script-question/4050 "2012-02-23T12:52:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinmarchand](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@kevinmarchand](https://forum.inductiveautomation.com/u/kevinmarchand)\
**Post date:** [February 23, 2012, 12:52pm UTC](https://forum.inductiveautomation.com/t/script-question/4050/1 "2012-02-23T12:52:03Z")

</div>

Hi,  
I have a LED display and I would like to add a increment by 1 button.  
I succed by doing it 2 way and I would like to know which one is the most efficent.  
My button as a dynamic parameter called Increment.

Script #1.

val = system.tag.getTagValue(“MyTagName”);  
val = val - event.source.Increment;  
system.tag.writeToTag(“MyTagName”,val);

Script #2.

event.source.parent.getComponent(‘LED Display’).value = event.source.parent.getComponent(‘LED Display’).value + event.source.Increment

Thanks

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 23, 2012, 5:34pm UTC](https://forum.inductiveautomation.com/t/script-question/4050/2 "2012-02-23T17:34:41Z")

</div>

Both are fine. I prefer the first one since you get the tag value and increment by one in the script. The second one will only work if the led’s value is bound bi-directionally to the tag (that is if you want the tag to update).
