User:Dan Bron/Temp/ErrorsInInterfaceToJ

From J Wiki
Jump to navigation Jump to search

Yuri,

It's been a long time since I've used J indirectly like this, but I believe the case was:

  • JErrorTextM will almost always return "Busy with previous input". This result is fairly meaningless (on par with the output of a C compiler when you forget a semicolon or brace).
  • It simply indicates your application has broken (and may be suspended, as with 13!:0]1 ? I forget).
  • If you want more detailed insight into the problem, inspect the result of the previous call to JDo. Zero indicates success, non-zero indicates failure, and is similar to an index into 9!:8 i.0 (J's list of error messages).
  • I say "similar to" because you must subtract one first (to account for the fact that zero indicates success and therefore can't also indicate failure of the type 0{9!:8 i.0 ). If you like, you can think of the result of JDo as an index into (<'OK'),9!:8 i.0 (or as <:13!:11 i.0).
  • Obviously, 9!:8 i.0 can give you the type of the error, but not its location. For that information, try 13!:12 i.0 . That will sometimes contain the name of and line number in the entity which broke (usually a named verb).