Steven Taylor-3 wrote:
> 
> Hi,
> 
> say I've got a verb train, that I like as a verb train... and I don't want
> to break it up.  Is there a way to check for an error condition?
> 
>    3 (]{~ [ I.~]) i. 4
> 3
> 
>    4 (]{~ [ I.~]) i. 4
> |index error
> |   4    (]{~[I.~])i.4
> |[-0]
> 
> 

You can use Adverse (::) conjunction:

   verb=:]{~ [ I.~]

   err=:'verb oops!'"_

   3 verb i.4
3

   3 verb :: err i.4
3

   3 verb i.3
|index error: verb
|   3     verb i.3

   3 verb :: err i.3
verb oops!



> I could set an initial value like this...
> 
>    fail=.0 [ret=. 4 { i.4  [ fail=.1
> 
> i.e. fail should equal zero if   ret=.4 runs correctly.
> 
> I was looking at these foreigns briefly.
> errno=:13!:11
> errmsg=:13!:12
> errno''
> errmsg''
> 
> these foreigns appear to be geared towards debug sessions though.
> 
> thanks,
> -Steven
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> 

-- 
View this message in context: 
http://old.nabble.com/error-handling-for-long-verb-trains-tp32425450s24193p32425938.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to