You probably want to put  require'files'  at the top of that script.

-Dan

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Sprague, Webb (OFM)
Sent: Friday, March 26, 2010 4:33 PM
To: General forum
Subject: Re: [Jgeneral] Function: open file, barf if doesn't exist

This looks promising, but it doesn't work (J504 -- various reasons, but
we can't upgrade)

> Here is a variation which I think will do what you want:
> 
> readfile =: 3 : 0
>        if. fexist y do.
>               fread y
>        else.
>               ('readfile: ', y, ' does not exist') 13!:8(24)
>        end.
> )

   x =. readfile 'c:\git_shell_ext_debug.txt'
      x =. readfile 'c:\git_shell_ext_debug.txt'
|control error: readfile
|readfile[1]

Thanks for your attention!
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to