Dan - this doesn't solve the problem.  What he's trying to do is something I
brought up at an NYCJUG meeting in May - i.e. an expression like this:

   savemat_jviewmat_ 'C:\Temp\immex0.bmp'[wait 1[viewmat i. 16 16

displays and saves a blank viewmat image.  On the other hand, entering

   viewmat i. 16 16
   savemat_jviewmat_ 'C:\Temp\immex0.bmp'

in immediate execution works fine.

This is frustrating for me because I tend to develop in immediate execution
and rely on the behavior remaining the same when I gather together the
working lines from the session and put them into a function definition.  In
this case, I use the "image3" functions for a workaround.

On Mon, Dec 15, 2008 at 4:40 PM, Dan Bron <[email protected]> wrote:

> I wrote:
> >  you might try using a (latent) immex phrase.
>
> Roelof responded:
> >  I assume you mean that I should stick that before the saveviewmat
> command.
>
> Sorry for being unclear.
>
> I didn't read the thread in detail, but I got the impression that you have
> some asynchronous GUI effects that need to be run from immediate execution
> to work properly.  This problem has arisen before.
>
> A common (to use the word generously) solution is to use the "immex phrase"
> (latent expression) foreigns.  These foreigns permit you to schedule a
> sentence to execute the next time J becomes free.  That is, when J is done
> with all its other work, just before it returns to immediate execution
> (the idle state where it awaits commands), it will execute your sentence.
>
> The foreigns are already packaged up neatly by the standard verb
> runimmx1_jijs_  .  So what I'm suggesting is that you replace
> savemat_jviewmat_ blah  with  runimmx1_jijs_ 'savemat_jviewmat_ blah'  in
> your verb.
>
> If you do so, you must keep in mind that the  savemat_jviewmat_  will be
> executed *after your verb completes*, so the remainder of your verb (or
> script, or anything else) cannot depend upon its results or side effects.
> Also remember you can only have one immex phrase (but of course it can do
> more than one thing).
>
> Does that help?
>
> -Dan
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to