Close dialog box in exit

Close dialog box in exit

Anonymous
Not applicable
1,408 Views
2 Replies
Message 1 of 3

Close dialog box in exit

Anonymous
Not applicable

I'm having a 'I can't get my mind back to work after a weekend' moment.

 

I have a routine that -

  opens a dialog box

  allows users to choose plines

  then shows blocks along the pline

If there is an invalid block, the program opens another dialog box that -

  asks user if they want to continue or exit

 

 

If user continues, there is no problem with the command.

 

If the user selects exit the command, the program issues the (exit), then AutoCAD freezes.

I tried issuing - (done_dialog 0) before the (exit), but it still freezes.

 

 

 

0 Likes
1,409 Views
2 Replies
Replies (2)
Message 2 of 3

john.uhden
Mentor
Mentor

I am not familiar with such symptoms, but I rarely use the (exit) function.  In fact, I think the only time I use it is for my client's programs.  In case one of the employees steals the .FAS or .VLX, files I have each program check the environment and if not known it exits.  The programs are proprietary and provide my client a huge advantage over his competition.  So he can't afford to let the enemy steal his weapons.

 

Is there a way to steer your program to a normal finish by bypassing the part that would continue?

Like put all the continue stuff in a (continue) function.

John F. Uhden

0 Likes
Message 3 of 3

scot-65
Advisor
Advisor
Are you closing the first dialog, then opening the second?
Are the OK/Cancel tiles of your design [meaning not using the built-in]?

The (exit) function should be placed after the (outermost) start_dialog.

I suspect you need a WHILE / COND program structure to do what you
are trying to describe? The method below does not require the exit
function due to it's geometry.

; sd=0 is exit
; sd=1 is success
; sd=2 is main
; sd=3 is secondary
; [anything greater than 3 will set sd to 0]

(setq sd 2)
(while sd>1
(cond
sd=2 call main dialog... new/done/(setq sd (start_dialog))
sd=3 call secondary dialog... new/done/start
T (setq sd 0) ;[not needed...]
);cond
);while

(if sd=1
execute...
exit... [this line is not needed...]
);if

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes