I have found the following code helpful in loading J scripts:
lcd =: 3 : ' (4!:4<''lcd'') { 4!:3 $0 '
COMMON_SCRIPT_PATH=: ;}:}:;:>lcd''
NB. path of directory from which this script is being run.
This allows me to put associated scripts in any directory, launch the root
script of that set (via jconsole.exe) and have that script load the other
scripts by determining its own path. The load sentences are like this:
load COMMON_SCRIPT_PATH, 'somescript.ijs'
Thanks goes to Dan Bron for directing me to this useful code.
--Tracy
On Sun, Oct 30, 2011 at 5:03 PM, Andrew Pennebaker <
[email protected]> wrote:
> If I have a local file coolstuff.j, where do I put coolstuff.j so that I
> can do load 'coolstuff.j' from anywhere? If possible I'd like to put all my
> J code in ~/.j or a similar directory and have J know to look there when
> loading code.
>
> In other words, where does J search for code?
>
> Does J have an environment variable similar to Java's $CLASSPATH?
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm