Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Karol-Or
Posts: 265
Registered: ‎11-28-2011
Message 1 of 2 (116 Views)

How to cancel the return value of the REPEAT command

116 Views, 1 Replies
01-10-2013 10:15 AM

I use the Repeat command with an index, and when it exits, it writes the last index.

I cannot move it to a new line,nor cancel it.

If i insert a (princ "\n") inside the loop it moves it to a new line, but also all  the outputs of the loop get extra line spaces

Distinguished Mentor
Moshe-A
Posts: 745
Registered: ‎09-14-2003
Message 2 of 2 (107 Views)

Re: How to cancel the return value of the REPEAT command

01-10-2013 11:20 AM in reply to: Karol-Or

Karol,

 

1. (repeat) is a function not a command.

 

2. (repeat) returns the value of the last expression or atom evaluated

 

3. put (princ) [with out any arguments] after (repeat) for quiet exit to cmd line

 

 

(setq i 0)

(repeat 15

   .....                        ; your code here

   .....

   .....

  (setq i (1+ i))

)

 

(princ)

 

 

moshe

 

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.