Johntosh Posted November 10, 2008 Posted November 10, 2008 Is it possible to loop through commands until the user excapes? I.E: User clicks button on my DCL box.. .. while active... (setq pt (getpoint "\nPlace your target notes...") ) (command "_.CIRCLE" pt 10) (command... (command "_.TEXT..... with increment ...loop until user escapes... Please assist. Quote
Lee Mac Posted November 10, 2008 Posted November 10, 2008 Hi John, Use a "while" function: i.e. (while (/= (setq pt (getpoint "\nPlace your target notes...") ) nil) (command "_.CIRCLE" pt 10) (command... (command "_.TEXT..... with increment ) ; end while Quote
Johntosh Posted November 10, 2008 Author Posted November 10, 2008 As simple as that.... Thanks Lee. Quote
Lee Mac Posted November 10, 2008 Posted November 10, 2008 No probs John, Looks like you're creating a LISP to place some notes, I would suggest possibly using an "and" command coupled with the "while" i.e. (while (and (/= (setq pt1 (getpoint "\nSelect Point for Text: ")) nil) (/= (setq txt (getstring t "\nSpecify Note Text: ")) "") ) (command "_circle" etc etc... ) ; end while This way, the LISP requires both data inputs to continue - and the user can exit the LISP at either the "Select Point" stage or the "Specify Text" stage. But perhaps this isn't what you're after. - just a suggestion Quote
Johntosh Posted November 10, 2008 Author Posted November 10, 2008 ...thus making sure all user entry is in before committing anything to the database! I like it, thanks again. Quote
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.