The problem of scripts is that all users need the script on the hard disk
(if you consider the use of the macro in a network). And so you need to look
for the file scripts etc...That is why I prefer that my macro defines itself
the function, like you proposed in the alternative solution.
The important is the use of single quotes to define a function.

Thank you very much.
Damien.



2007/8/3, bill lam <[EMAIL PROTECTED]>:
>
> I think that it will be more convenient to use script for non-trivial
> applications, eg.
>
> ===== define this inside a myscript.ijs ===
> function=: 3 : 0
> a=. y
> a + 1
> )
>
> NB. possibly other definitions ...
>
> ===========================================
>
> then load the script
> js.Do("0!:0 <'path_to_myscript.ijs'")
>
> alternatively, develop some verb to convert the content of J script into
> well
> formated string
>
> vbstring= "'function=: 3 : 0" & vbNewLine & "a=. y" & vbNewLine & "a+1"
> & vbNewLine & ")'"
>
> js.Do("0!:100 " & vbstring)
>
> Damien wrote:
> > Hello everybody,
> >
> > These days, I am working a lot with J via excel.
> > I can easily execute J commands thanks to excel, with for example :
> js.Do
> > ("my_1_line_command").
> > Now, I would like to use a cholesky decomposition of my excel data.
> > However, I have not found any means to the following things : I can not
> send
> > to J something like :
> > function=: 3 : 0
> > a=. y
> > a + 1
> > )
> > ...because there are several lines.
> >
> > I tried : js.Do("function=: 3 : 0" & vbNewLine & "a=. y" & vbNewLine &
> "a+1"
> > & vbNewLine & ")" )...unfortunately, it does not work, I get a spelling
> > error.
> > I could maybe use something like : js.Do("function=: 3 : 'a+1 [ a=.y'"),
> but
> > it is not very convenient when the function is quite long.
> > Any idea ?
> >
> > Thanks.
> > Damien.
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
> --
> regards,
> bill
> ----------------------------------------------------------------------
> 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