March 2017
Beginner
358 pages
9h 51m
English
There is already a macro for scaffolding out a for loop (Hint: It's for), so let's build one for a do-while loop.
If you're not familiar with a do-while loop, it's just like a while loop, except that the do comes before the while, so the code block executes at least once before the conditions are evaluated (whether they would evaluate to true or not). If the condition in the while expression evaluate to a truthly value, then the do block executes again and again, until the condition evaluates to a falsely value. A do-while loop generally looks something like this:
do { /*code that will execute at least once*/ } while(/*condition*/);
To create our own editor macro, let's follow the following steps:
Read now
Unlock full access