a=. 0 ; 0
echo on
title Running  J in bat
pushd
setlocal

rem test if J is available
if not exist c:\j701\bin\jconsole.exe  goto Exception01
rem test if the script is there
if not exist c:/j701/bin/testscript.txt goto Exception02

set jexe=c:\j701\bin\jconsole -js
set jscr="0!:0<'c:/j701/bin/testscript.txt'"

rem run J process and exit
%jexe% %jscr%  "testout 0" "exit 54)"

ECHO error level is %ERRORLEVEL%

if ERRORLEVEL  4 goto Exception04

if ERRORLEVEL  3 goto Exception03



title  J complete!
goto TheEnd

:Exception01
echo ERROR: jconsole.exe not found
title  J not there!
goto TheEnd

:Exception02
echo ERROR: script not found
title script not there
goto TheEnd

:Exception03
echo DONE result three
notepad out.txt


title result is three
goto TheEnd

:Exception04
echo DONE result four

notepad out2.txt

title reult is four
goto TheEnd


:TheEnd

endlocal
popd
)

a fwrite 'jtest.bat'

then you run jtest

Þann 2. nóvember 2011 22:14, skrifaði David Vaughan <
[email protected]>:

> So how would I go about doing it? (Mac and Windows).
>
> ___________________________
>
> David Vaughan
>
> On 29 Oct 2011, at 11:53, Björn Helgason <[email protected]> wrote:
>
> > It depends on the os
> >
> > In linux you can make a file executable
> >
> > In windows you can create a bat file
> >
> >
> >
> > 2011/10/29 David Vaughan <[email protected]>
> >
> >> How can an executable be made from J, assuming it is possible?
> >>
> >> ___________________________
> >>
> >> David Vaughan
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >
> >
> >
> > --
> > Björn Helgason, Verkfræðingur
> > Fornustekkum II
> > 781 Hornafirði,
> > t-póst: [email protected]
> > gsm: +3546985532
> > twitter: @flugfiskur
> > http://groups.google.com/group/J-Programming
> >
> >
> > Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
> >
> > góður kennari getur stigið á tær án þess að glansinn fari af skónum
> >          /|_      .-----------------------------------.
> >         ,'  .\  /  | Með léttri lund verður        |
> >     ,--'    _,'   | Dagurinn í dag                     |
> >    /       /       | Enn betri en gærdagurinn  |
> >   (   -.  |        `-----------------------------------'
> >   |     ) |         (\_ _/)
> >  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
> >   `. )----'        (")_(") ☃☠
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: [email protected]
gsm: +3546985532
twitter: @flugfiskur
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.
         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |         (\_ _/)
  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
   `. )----'        (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to