On Wed, Apr 7, 2010 at 5:51 PM, Sprague, Webb (OFM)
<[email protected]> wrote:
> For example, if I have a program stored in C:\STUFF\foo.ijs, I would
> like to be able to say "sourcepath=.<J MAGIC HERE>" and then later "load
> (sourcepath,bar.ijs)" in order to load a program that is stored in the
> same directory.

filepath=: 'c:\stuff\foo.ijs'
dirname=: #~  '/\' +./\...@e.~ ]

   dirname filepath
c:\stuff\

As for Chris Burke's response, let us say that
you wanted to know which file contained the
definition for the word 'define', on your system.

To find that, you could run:

   (4!:4<'define') {:: 4!:3''

FYI,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to