Basics of Creating a Counter

This should serve as a good example to get you started.
As always, please feel free to post any comments, issues, and/or suggestions you may have concerning this macro.

Example Output

image

MACRO:   How to Use a Counter [Example]


#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/5/5/55417b8b2628112929bf26e976c6ff7adc01ad31.kmmacros">How to Use a Counter [Example].kmmacros</a> (4.7 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---

![image|617x998](upload://1FLUVAdNnCJBXsEHFMyea9gtChq.jpg)

---

**NOTE:** The `+ 1` shows up in red because the variable "Local__Counter" is a _local_ variable, and is not defined until execution time.

![image|543x170](upload://z1RFB8qzNFR0EBfGjQ3sBm7gBEr.png)

@peternlewis, this display behavior does not make any sense to me, and misleads us.
You should not show any "errors" in red related to _Local_ or _Instance_ variables.
Please consider making a change to KM.
2 Likes