Author Topic: error: quit / exit abort  (Read 4673 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
error: quit / exit abort
« on: August 08, 2011, 08:13:32 AM »
Dear all,
plz chk my lisp some error on (exit) option

Quote
; error: quit / exit abort
autocad ver 2012 32bit
Code: [Select]
(defun c:test () ;define the function
  (setq dcl_id (load_dialog "test.dcl")) ;load the DCL file
  (if (not (new_dialog "main" dcl_id)) ;load the dialog box
    (exit) ;if not loaded exit
  )
  (action_tile
    "cancel"
    "(done_dialog)
(setq result nil)"
  ) ;do this if Cancel button selected
 
  (action_tile
    "accept"
    "(done_dialog)
(setq result T)"
  ) ;do this if OK button selected
 
  (action_tile
    "next"
    "(test1)"
  ) ;if Next button is selected, call
;the tested dialog function
 
  (start_dialog) ;start the dialog
  (unload_dialog dcl_id) ;unload the dialog
  (princ)
) ;defun


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun test1 () ;define the function
  (setq dcl_id1 (load_dialog "test.dcl")) ;load the DCL file
  (if (not (new_dialog "test1" dcl_id1)) ;load the tested dialog box
    (exit) ;if not loaded exit
  )
  (action_tile
    "cancel"
    "(done_dialog)
(setq result1 nil)"
  ) ;if cancel selected do this
  (action_tile
    "accept"
    "(done_dialog)
(setq result1 T)"
  ) ;if OK selected do this
  (action_tile
    "next"
    "(test2)"
  ) ;if Next selected call the
;second tested dialog function
 
  (start_dialog) ;start the tested dialog box
  (unload_dialog dcl_id1) ;unload the tested dialog box
  (princ)
) ;defun


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun test2 () ;define the function
  (setq dcl_id2 (load_dialog "test.dcl")) ;load the DCL file
  (if (not (new_dialog "test2" dcl_id2)) ;load the second tested dialog box
    (exit) ;if not found exit
  )
  (action_tile
    "cancel"
    "(done_dialog)
(setq result2 nil)"
  ) ;do this if Cancel selected
  (action_tile
    "accept"
    "(done_dialog)
(setq result2 T)"
  ) ;do this if OK selected
  (start_dialog) ;start the second tested dialog box
  (unload_dialog dcl_id2) ;unload it
  (princ)
) ;defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ) ;load clean
;|«Visual LISP© Format Options»
(200 2 40 2 nil "end of " 60 9 0 0 nil T T nil T)
;*** DO NOT add text below the comment! ***|;

dcl code
Code: [Select]
////////////////////////////////////////////////
main : dialog {
label = "Main Dialog";
: column {
: text {
key = "txt1";
value = "This is the main dialog box.";
}
: text {
key = "txt2";
value = "To display the next, tested dialog,";
}
: text {
key = "txt3";
value = "Press Next....";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Next";
key = "next";
width = 12;
fixed_width = true;
mnemonic = "N";
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
: spacer { width = 1;}
}
}
////////////////////////////////////////////////
test1 : dialog {
label = "1st tested Dialog";
: column {
: text {
key = "txt1";
value = "This is the first tested dialog box.";
}
: text {
key = "txt2";
value = "To display the next, tested dialog, press Next";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Next";
key = "next";
width = 12;
fixed_width = true;
mnemonic = "N";
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
: spacer { width = 1;}
}
}
////////////////////////////////////////////////
test2 : dialog {
label = "2nd tested Dialog";
: column {
: text {
key = "txt1";
value = "This is the last tested dialog box.";
}
}
: row {
: spacer { width = 1; }
: button {
label = "OK";
key = "accept";
width = 12;
fixed_width = true;
mnemonic = "O";
is_default = true;
}
: button {
label = "Cancel";
key = "cancel";
width = 12;
fixed_width = true;
mnemonic = "C";
is_cancel = true;
}
: spacer { width = 1;}
}
}
////////////////////////////////////////////////
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

kruuger

  • Swamp Rat
  • Posts: 637
Re: error: quit / exit abort
« Reply #1 on: August 08, 2011, 09:39:06 AM »
you need to put your test.dcl file under autocad support path.
kruuger

HofCAD

  • Guest
Re: error: quit / exit abort
« Reply #2 on: August 08, 2011, 05:52:55 PM »
you need to put your test.dcl file under autocad support path.
kruuger
Or put the DCL codes within the same Lisp file.
See topic: http://www.theswamp.org/index.php?topic=37462.msg424675#msg424675
and in the attachment SamTest.lsp.
And also as an example my HofDriven.lsp in topic: 'AutoLisp kinematics with dim constraint?'.
http://www.theswamp.org/index.php?topic=38329.msg434253;topicseen#msg434253

Regards, HofCAD CSI.

« Last Edit: August 08, 2011, 09:20:26 PM by HofCAD »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: error: quit / exit abort
« Reply #3 on: August 08, 2011, 08:12:00 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sam

  • Bull Frog
  • Posts: 201
Re: error: quit / exit abort
« Reply #4 on: August 09, 2011, 01:09:05 AM »
Dear sir,
cab & hofcad
thx for help
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html