Thomas Costigliola wrote:
> I am bulding a stand-alone program (running with "-jprofile myprogram.ijs").
> Can this be used to write the output of running a script to an ijx window I
> create myself? I have been looking at jijs.ijs but I cuold not figure out how
> the sessions knows that (1!:2)&2 should write to the ijx window. Is this hard
> coded? If so how, how exectly is the ijx window identified by internally?
>
In Jwd, the 1!:2&2 writes to the ijx form, if any. The normal J profile
creates an ijx window, so running your app without the -jprofile
parameter will do this.
You can create an ijx window yourself, and this can be useful when
testing applications. A minimal ijx window can be found in
system\extras\util\minijx.ijs.
For example, create the script below, and an icon that runs it,
something like:
c:\j6\j.exe -jprofile myscript.ijs
Run it, and note that clicking the button gives no output.
Now remove the NB. and run the script again. This time, a session
appears and you can see the output.
-------
NB. 11!:0 'pc ijx closeok;xywh 0 0 300 200'
NB. 11!:0 'cc e editijx ws_hscroll ws_vscroll es_nohidesel'
NB. 11!:0 'setfont e ',>(5=9!:12'') { '"Courier New" 12';'monospaced 12'
NB. 11!:0 'pas 0 0;pgroup jijx;pshow'
11!:0 'pc abc closeok'
11!:0 'cc ok button'
11!:0 'pshow'
wdhandler_z_=: 6!:1 (1!:2) 2:
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm