> Why do you want the extra 'reset' after closing?  It will close all other 
> windows as well.

So *that's* what's doing it! :-)
I was blindly lifting code from some other example, I forget which.

> an alternative for try-catch could be the adverse conjunction (::)

Yes, that looks much neater. (I needed the error-tolerant
precautionary pclose because without it, garbage windows build up
underneath the current one during the code/test cycle, if you go with
just what the Form Editor generates for you).

Seems like Adverse as you've used it corresponds to Visual Basic's
devilishly handy "On Error Resume Next" -- which I think of as
Chernobyl programming. But it has its uses. Like: here.

Thanks Bill and everyone for eyeballing my code. I knew I'd learn something.

Ian

PS nobody's told me off for "nilad define"! ;)


On Wed, Jan 20, 2010 at 2:13 PM, bill lam <[email protected]> wrote:
> In the verb close
>
> close=: nilad define                    NB. Terminate the app and close its 
> window
>                                        NB. 
> ----------------------------------------
> try.                                    NB. closing window gives error if 
> it's absent
>  wd 'psel lobrow'                      NB. finds the right window
>  wd 'pclose'
>  wd 'reset'
> catch.
> end.
> )
>
> Why do you want the extra 'reset' after closing?  It will close all other 
> windows as well.
>
> an alternative for try-catch could be the adverse conjunction (::)
>
>  wd ::0: 'psel lobrow;pclose'
>
> Waiting for your next project.  ;-)
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to