# Best practice with do loops

Hey, I have a beginners question:
How can I write this shorter. I’m pretty sure there is a way, but can’t find it in the help:

``````(
i = 0;
8.do{
i=i+1;
('Execute'++i).postln;
}
)

``````

Perhaps one of the below?

8.do({ arg i; (i + 1).postln })
1.to(8).do({ arg i; i.postln })
(1 … 8).do({ arg i; i.postln })

Ps. The “Look Up Implementations…” entries in the “Language” menu of the editor can be a nice way of finding things…

``````8.do{|i|('Execute'++i).postln};
``````

thanks! I didn’t know about the “Loop Up Implementation”. That helps

That’s exactly what I was searching for. Thanks! So the argument counts upwards automatically!

``````8.do{ |i| (\Execute ++ (i + 1)).postln }
``````
``````(1..8).do{ |i| (\Execute ++ i).postln }
``````