Page 1 of 1

Alert box closing main dialog

Posted: Tue Mar 21, 2023 2:07 am
by sln8458
Hi,
I'm adding a 'check selection' loop into my piping utility, but while one works another does not!
Here's a video, where the first alert works as expected in that when you select 'OK' the alert box closes allowing the user to correct their mistake.
But the second alert, when the user selects 'OK' it closes bothe the alert & the main dialog, and I can't seem to find why?
https://www.dropbox.com/s/ieqkq2p1btczu ... e.avi?dl=0.

lsp file attached.

SteveN

Re: Alert box closing main dialog

Posted: Tue Mar 21, 2023 4:26 am
by SPirou4D
Morning Steve,
I mean you don't need a OK and Cancel buttons because when you choose in the popup windows, it close it. No?
Your choice close the windows.

Re: Alert box closing main dialog

Posted: Fri Mar 24, 2023 5:03 am
by sln8458
Solved my problem, re-wrote the check selections into 3 descrete sections:

Code: Select all

(defun CHECK_SELECTIONS_FE ()
	(cond
		((/= fit_ftg NIL)(setq john fit_ftg)(CHECK_SELECTIONS_F))
		((/= ftg NIL)(setq john ftg)(CHECK_SELECTIONS_F))
	);end cond
) ;end CHECK_SELECTIONS_FE
;
(defun CHECK_SELECTIONS_F ()
;
	(setq ftg john)
	(setq john "")
;
  (cond
		((/= fit_sch NIL)(CHECK_SELECTIONS_FSC))
		(t (alert "OOPS! *new dialog* SELECT A FITTING SCHEDULE - TRY AGAIN!"))
  );end of cond
) ;end CHECK_SELECTIONS_F
;
(defun CHECK_SELECTIONS_FSC () 
;
	(setq sch fit_sch)
	(setq fit_sch "")
; 
   (cond 
		((/= size NIL)(term_dialog))
		(t (alert "OOPS! *new dialog* SELECT A FITTING SIZE - TRY AGAIN!"))
  );end of cond 
) ;end CHECK_SELECTIONS_FSC
Once each one is passed it calls the second.
The 2 setq's in the second and third checks are setting variables for the main app.

SteveN