# For-loop counter other than usize

**URL:** <https://ziggit.dev/t/for-loop-counter-other-than-usize/4744>\
**Category:** Help\
**Tags:** language\
**Created:** [June 16, 2024, 2:49am UTC](https://ziggit.dev/t/for-loop-counter-other-than-usize/4744 "2024-06-16T02:49:05Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [June 17, 2024, 1:02pm UTC](https://ziggit.dev/t/for-loop-counter-other-than-usize/4744/16 "2024-06-17T13:02:20Z")

</div>

> [@Range: a simple little numeric range iterator](https://ziggit.dev/t/range-a-simple-little-numeric-range-iterator/4772):
>
> With one additional line of code, you get: Control the type of iterated numeric values. var r = Range(i8){ .from = -2, .to = 2 }; while (r.next()) |i| { ... Ascending or descending iteration. var r = Range(i8){ .from = 2, .to = -2 }; while (r.next()) |i| { ... Control the iteration step. var r = Range(i8){ .from = -2, .to = 2, .step = 2 }; while (r.next()) |i| { ... Range over the values of a type. var r = Range(u4){ .inclusive = true }; while (r.next()) |i| { ... [https://codeberg.o…](https://codeberg.org/dude_the_builder/range)

---

_[View the full topic](https://ziggit.dev/t/for-loop-counter-other-than-usize/4744)._
