Actually I have a question too.
The User manual states:
"Jwd tests at the end of the execution of every sentence. If there is an
error and no ijx window, then a message is displayed and the session is
terminated after the message is closed. If there are no forms, then the
sesssion [sic] is terminated."
I took this to mean that the J session invoked by the instructions in my
last post would terminate at the end of the script. This doesn't seem to
happen and each time I run the command from the CMD prompt a new J
session is started and not closed (as seen in the Task Manager). Can
anyone explain?
In the meantime if no GUI is required it is probably better to use
jconsole anyway, but then you need to make sure that the last command of
the script is exit'' to terminate the jconsole session.
The example now becomes:
c:\my folder>"c:\program files\j602\bin\jconsole.exe" -jijx
runscript.ijs "argument one" argument-two
======runscript.ijs=====================
load 'files'
'hello world' fwrites jpath '~temp/test.txt'
(>ARGV_j_) fwrites jpath '~temp/test2.txt'
args=: 3}. ARGV_j_
('ONLY EXTRA ARGS FOLLOW',LF) fappends jpath '~temp/test2.txt'
(> args) fappends jpath '~temp/test2.txt'
exit''
======end of script=====================
---Sherlock, Ric wrote:
> Save the following as script file in some folder (say c:\my folder).
> >From a CMD prompt session in that folder call the script like this:
> c:\my folder>"c:\program files\j602\bin\j.exe" -jijx runscript.ijs
> "argument one" argument-two
>
>
> Now check your temp folder for the files test.txt & test2.txt.
>
> ======runscript.ijs=====================
> NB. call from folder containing runscript.ijs with:
> NB.
>
> load 'files'
> 'hello world' fwrites jpath '~temp/test.txt'
> (>ARGV_j_) fwrites jpath '~temp/test2.txt'
> args=: 3}. ARGV_j_
> ('only extra args',LF) fappends jpath '~temp/test2.txt'
> (> args) fappends jpath '~temp/test2.txt'
> ========end script=======================
>
> PackRat wrote:
> > I thought a useful next step in the process would be to
> > invoke J with a particular script (and perhaps arguments,
> > too), so that
> > my "master" scripting language(s) could have merely a
> single "shell"-
> > like command rather than a series of commands that simulate
> manually
> > typing a script into J.
> >
> > Similar to what I've noted in other previous messages, as a
> > beginner I
> > found it extremely difficult to find information along this
> > line. The
> > "Command Line Parameters" chapter in the "Overview" section of the
> > online "User Manual" (Usr) seemed to have what I was
> looking--with an
> > emphasis on "seemed" because I still can't get anything to
> > work, hence
> > my question. The chapter gave 4 groups of patterns for
> invoking J in
> > various circumstances.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm