From the course: Learning AutoLISP & Visual LISP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Function: repeat

Function: repeat - AutoCAD Tutorial

From the course: Learning AutoLISP & Visual LISP

Start my 1-month free trial

Function: repeat

- [Instructor] Another loop function is the repeat function. The repeat function will repeat all the arguments all the items found within the list a set number of times. This loop type function is a little bit more controlled in that it repeats a very defined number of times. Let's go ahead and create that. We're going to type in REPEAT. We type in the number of times it's going to repeat and then we simply type in what it's going to do. This is the arguments that we'll continue walking through and doing until or a total of 10 times. Now let's just change that counter a few times and then close our repeat. All we're doing is we're repeating and writing the command line our number counter a total of 10 times and we're of course looping through an iterate or adding to this counter each time. Let's go ahead, and I'm going to select all the text. We're going to run it. You see that it typed all of these different things in. But what did it type to the command line? It only typed zero…

Contents