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
