TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ElpanovEvgeniy on November 13, 2010, 07:31:37 AM

Title: VLX protected, how to interrupt the function by pressing the Escape?
Post by: ElpanovEvgeniy on November 13, 2010, 07:31:37 AM
I have a function that works for very long. After compiling a VLX protected, how to organize an interrupt function by pressing Escape?
Title: Re: VLX protected, how to interrupt the function by pressing the Escape?
Post by: Lee Mac on November 13, 2010, 08:54:08 AM
I haven't tried it, but will Ctrl+C not terminate the program? I might be way off the mark here though...  :-(
Title: Re: VLX protected, how to interrupt the function by pressing the Escape?
Post by: ElpanovEvgeniy on November 13, 2010, 08:58:34 AM
to check:
Title: Re: VLX protected, how to interrupt the function by pressing the Escape?
Post by: ElpanovEvgeniy on November 13, 2010, 09:33:04 AM
as variant:
Code: [Select]
(defun c:test (/ TIME)
 ;;(c:test)
 (setq time (/ (car (_VL-TIMES)) 1000))
 (princ "\nProgram is running - 60 seconds")
 (while (< (- (/ (car (_VL-TIMES)) 1000) time) 60)
  (esc_exit)
 )
 (princ)
)

(defun esc_exit ()
 (if (not sys-keystate)(setq sys-keystate(acet-sys-keystate 27)))
 (if (/= (acet-sys-keystate 27) sys-keystate)
  (exit)
 )
)
(vl-arx-import "acetutil.arx")