[Jprogramming] Setting the path in J?
Sprague, Webb (OFM)
Webb.Sprague at ofm.wa.gov
Sun Apr 18 08:20:22 HKT 2010
Thanks for the answer, but it isn't quite what I am after -- I am hoping to set the *search path* for files which are loaded or required by a script.
In a shell script, I would do this:
PATH="/my/special/path:$PATH"
Thanks!
-----Original Message-----
From: programming-bounces at jsoftware.com on behalf of Mark Allen
Sent: Fri 4/16/2010 2:40 AM
To: Programming forum
Subject: Re: [Jprogramming] Setting the path in J?
There's probably a 'proper' way to do this in Preferences, but the way I do
it, is with a line in my startup.ijs like
cd =: 1!:44
cd 'C:\RandomDirectory\'
Another useful command is
pwd =: '1!:43'
e.g.
pwd =. 1!:43
pwd ''
C:\RandomDirectory\
This is probably a completely ass-backwards way of doing things, like I
said, there's probably a proper way to set default paths in Configure, but
this is probably a good enough workaround till one of the pros gives you the
real answer :)
On 15 April 2010 20:32, Sprague, Webb (OFM) <Webb.Sprague at ofm.wa.gov> wrote:
> Is there a way to append scripts to the default path in J? (Sorry if my
> lingo is basically from shell scripting...)
>
> Basically, if I have a bunch of require 'blah' statements, I want my
> script to look in certain directories first and try to snarf them from
> there.
>
> Thanks again!
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list