how to close Modal control application via button

hello
i want to crate a button to close a modal-opened control application, just simple close… i don’t want to use the exit button comes with it.
created php button and tried sc_redir, sc_exit with all their functions, nothing worked as required
any simple solution for this?

http://www.scriptcase.net/forum/showthread.php?3988-Close-a-blank-application-when-it-shows-as-a-modal-window&p=16397&viewfull=1#post16397

Thanks Albert
sc_exit didn’t work as supposed to, nor sc_redir options… i simply wanted to close the modal form, only… like cancel, without using the buttons of the toolbar

this worked, by jsb, simple and straight forward
http://www.scriptcase.net/forum/forum/applications/grid-reports/6560-canceling-new-row-form-don-t-close

cheers

The links do not work anymore. Could you share your solution?

I think this is the link reference above: