Author Topic: VLX protected, how to interrupt the function by pressing the Escape?  (Read 2017 times)

0 Members and 1 Guest are viewing this topic.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
I have a function that works for very long. After compiling a VLX protected, how to organize an interrupt function by pressing Escape?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: VLX protected, how to interrupt the function by pressing the Escape?
« Reply #1 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...  :-(

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: VLX protected, how to interrupt the function by pressing the Escape?
« Reply #2 on: November 13, 2010, 08:58:34 AM »
to check:

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: VLX protected, how to interrupt the function by pressing the Escape?
« Reply #3 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")