LosGirk Posted August 3, 2014 Share Posted August 3, 2014 Greetings all, Hopefully someone can help with a question I have. What is the difference between these sections of code? Is done dialog 1 and set userclick T saying the same thing? (action_tile "accept" "(done_dialog 1)") (setq Return# (start_dialog)) and (done_dialog)(setq userclick T) I know the Return# has to do with having multiple dialog boxes with next and back buttons, but the ddiag1 and userclick T I'm having trouble with. Thanks your time, and have an extraordinary Sunday! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 3, 2014 Share Posted August 3, 2014 No difference at all , and it is all about the programmer which way to go through . After unloading the dialog there must be the following . e.g No: (1) (if (and Return# (eq Return# 1)) (progn ..... ) ) e.g No: (2) (if userclick1 (progn ..... ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 3, 2014 Share Posted August 3, 2014 What is the difference between these sections of code? Is done dialog 1 and set userclick T saying the same thing? (action_tile "accept" "(done_dialog 1)") (setq Return# (start_dialog)) and (done_dialog)(setq userclick T) They essentially result in the same dialog behaviour; though note that neither expressions are required as the action statements for the accept & cancel tiles are predefined with done_dialog returns of 1 & 0 respectively. Consider the following quick example to verify this: (defun c:dcltest ( / *error* dch dcl des ) (defun *error* ( msg ) (if (< 0 dch) (unload_dialog dch)) (if (= 'file (type des)) (close des)) (if (and (= 'str (type dcl)) (setq dcl (findfile dcl))) (vl-file-delete dcl)) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (if (and (setq dcl (vl-filename-mktemp nil nil ".dcl")) (setq des (open dcl "w")) (write-line "test:dialog{label=\"DCL Test\";spacer;ok_cancel;}" des) (not (setq des (close des))) (< 0 (setq dch (load_dialog dcl))) (new_dialog "test" dch) ) (if (= 1 (start_dialog)) (princ "\nUser pressed OK.") (princ "\nUser pressed Cancel.") ) ) (*error* nil) (princ) ) Quote Link to comment Share on other sites More sharing options...
LosGirk Posted August 4, 2014 Author Share Posted August 4, 2014 Thanks you guys, you're awesome. Got me over the hump! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 4, 2014 Share Posted August 4, 2014 Thanks you guys, you're awesome. Got me over the hump! Good luck. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.