Author Topic: Cancel While  (Read 945 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Cancel While
« on: April 27, 2016, 05:56:56 PM »
Hello such, I would like to know how I can cancel my lisp while without leave me the message "; error: Function canceled"

Code: [Select]
(defun CopyMblock ()
(setvar "cmdecho" 0)
(while
(setq msxb (strcat  "\n>> Punto de Inserción del bloque [ " bloqxlist " ]: "))
(princ msxb)
(cond ((= selex "1:20") (setq opcion3 0.4))
      ((= selex "1:25") (setq opcion3 0.5))
      ((= selex "1:50") (setq opcion3 1))
      ((= selex "1:100") (setq opcion3 2))
      ((= selex "1:125") (setq opcion3 2.5))
      ((= selex "1:200") (setq opcion3 4))
      ((= selex "1:250") (setq opcion3 5))
      ((= selex "1:500") (setq opcion3 10))
      ((= selex "MS:PS") (setq opcion3 20)))
(cond ((= key_tog1 "1") (command "._insert" bloqxlist "_s" *AX:Escala1*))
           ((= key_tog1 "0") (command "._insert" bloqxlist "_s" opcion3)))
    (while (= (logand (getvar "cmdactive") 1) 1) (command pause))
(vl-cmdf "explode" "last")
(princ "\nPresiona [ ESC ] para cancelar ") (TERPRI)
(cond (nil (prompt "\n**Cancel**"))))
(setvar "cmdecho" 1)
(princ))
« Last Edit: April 27, 2016, 06:06:40 PM by amc.dicsac »
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

ur_naz

  • Newt
  • Posts: 68
  • Made in Ukraine
Re: Cancel While
« Reply #1 on: April 27, 2016, 11:32:14 PM »
Try to use the *error* function

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Cancel While
« Reply #2 on: April 28, 2016, 04:21:50 AM »
This tutorial may help.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: Cancel While
« Reply #3 on: April 28, 2016, 12:15:35 PM »
Thanks LEE =)
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>