Page 1 of 1

Thyme for function

PostPosted: Fri Jul 06, 2018 8:35 pm
by Skrubs
How to use the function "For" in thyme ? how it works ?

Re: Thyme for function

PostPosted: Sun Aug 05, 2018 1:39 pm
by FRA32
The for function is used with this syntax:
for(limit,(counter)=>{code})
Limit is a number or variable containing a number, specifying for often the loop executes(it maxes out at 100 iterations however). The counter is any variable name, most often "i". It stores the index of the current iteration.
An example would be:

for(5,(i)=>{
text = text + i
})

After running the script, the objects text variable would have "01234" attached to the end.

Re: Thyme for function

PostPosted: Mon Sep 17, 2018 3:04 am
by Skrubs
Learned thanks