--- gforth/kernel/errore.fs 1998/12/08 22:03:09 1.4 +++ gforth/kernel/errore.fs 1999/12/12 18:35:55 1.8 @@ -22,6 +22,9 @@ \ The errors are defined by a linked list, for easy adding \ and deleting. Speed is not neccassary at this point. +require ./io.fs +require ./nio.fs + AVariable ErrLink \ Linked list entry point NIL ErrLink ! @@ -34,13 +37,16 @@ decimal \ error numbers between -512 and -2047 are for OS errors and are \ handled with strerror +has? OS [IF] : >stderr ( -- ) r> outfile-id >r stderr to outfile-id >exec r> to outfile-id ; +[ELSE] +: >stderr ; +[THEN] : .error ( n -- ) >stderr - cr ." Error: " ErrLink BEGIN @ dup WHILE @@ -59,4 +65,4 @@ decimal 512 + negate strerror type EXIT THEN [ [THEN] ] - . ; + ." error " dec. ;