I've found that a conflict between local variables in some of the library scripts and global variables in application scripts will cause an error when the standalone script is started from the command-line. No error occurs when using 0!:0 from minijx.

For example, stdlib.ijs contains the following lines:

t=. <;._1 '/invalid name ...
type=: {&t@(2&+)@(4!:0)&boxopen

(note that the line t=. is truncated above)

The local assignment in stdlib will cause a crash when a stand-alone application is built for the following script:

NB. testerr.ijs
coclass'test'
t=: 1
test=: 3 : 0
wd'mb "J" "hello world"'
)
cocurrent'base'
test''

The local assignment causes a problem even though the global assignment is in a different locale. The above will work fine from the J session manager or when loaded using 0!:0 in the minimal J window given by running j.exe -jprofile from the command line. The crash only happens when using

j.exe -jprofile test.ijs

from the command line, where test.ijs is the stand-alone script. Other single letter variables that cause the same problem are a, c, d, h, and j. It took some time to track this problem down the first time my stand-alone application gave the dreaded "Error and no IDE window for debugging" dialog. One solution would be to make all of the local "helper" assignments in the system scripts global assignments.

Norman Drinkwater



Chris Burke wrote:
Saunders, John (HMSRHS) wrote:
Thanks Chris, I now have the script working from the session manager
loaded without the jprofile by entering 0!:0 <'c:\EMA\salaries.ijs'
However I can't get it working form a desktop shortcut for some reason,
I've tried different syntax with no luck for example
C:\EMA\j.exe -jprofile salaries.ijs
C:\EMA\j.exe -jprofile \salaries.ijs
C:\EMA\j.exe -jprofile c:\EMA\salaries.ijs
I can load  c:\EMA\j.exe - jprofile from the desktop; though can't seem
to include the script??

This does not sound right. Loading J with:

  C:\EMA\j.exe -jprofile c:\EMA\salaries.ijs

should be essentially the same as loading J with:

  C:\EMA\j.exe -jprofile

and then entering

   0!:0 <'c:\EMA\salaries.ijs'

Is the Start In directory set correctly in your shortcut? What error
message do you get?
----------------------------------------------------------------------
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