version 1.11, 2000/09/23 15:46:53
|
version 1.18, 2007/12/31 18:40:24
|
Line 1
|
Line 1
|
\ Load in error strings |
\ Load in error strings |
|
|
\ Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1996,1997,1998,1999,2003,2007 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
\ Gforth is free software; you can redistribute it and/or |
\ Gforth is free software; you can redistribute it and/or |
\ modify it under the terms of the GNU General Public License |
\ modify it under the terms of the GNU General Public License |
\ as published by the Free Software Foundation; either version 2 |
\ as published by the Free Software Foundation, either version 3 |
\ of the License, or (at your option) any later version. |
\ of the License, or (at your option) any later version. |
|
|
\ This program is distributed in the hope that it will be useful, |
\ This program is distributed in the hope that it will be useful, |
Line 15
|
Line 15
|
\ GNU General Public License for more details. |
\ GNU General Public License for more details. |
|
|
\ You should have received a copy of the GNU General Public License |
\ You should have received a copy of the GNU General Public License |
\ along with this program; if not, write to the Free Software |
\ along with this program. If not, see http://www.gnu.org/licenses/. |
\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
|
|
|
[IFUNDEF] linked \ defined by chains.fs?! |
: linked ( addr -- ) |
: linked here over @ a, swap ! ; |
here over @ a, swap ! ; |
[THEN] |
|
|
|
: errstring ( addr u n -- ) |
: errstring ( addr u n -- ) |
ErrLink linked |
ErrLink linked |
, |
, |
string, align ; |
string, align ; |
|
|
variable next-exception -2048 next-exception ! |
|
|
|
: exception ( addr u -- n ) \ exception- gforth |
|
\G @var{n} is a previously unused @code{throw} value in the range |
|
\G (-4095...-256). Consecutive calls to @code{exception} return |
|
\G consecutive decreasing numbers. Gforth uses the string |
|
\G @var{addr u} as an error message. |
|
next-exception @ errstring |
|
next-exception @ |
|
-1 next-exception +! ; |
|
|
|
decimal |
decimal |
|
|
-1 s" Aborted" rot errstring |
-1 s" Aborted" rot errstring |
Line 97 decimal
|
Line 84 decimal
|
-56 s" QUIT" rot errstring |
-56 s" QUIT" rot errstring |
-57 s" Error in sending or receiving a character" rot errstring |
-57 s" Error in sending or receiving a character" rot errstring |
-58 s" [IF], [ELSE], [THEN] error" rot errstring |
-58 s" [IF], [ELSE], [THEN] error" rot errstring |
|
|
|
\ Gforth's errors: |
|
|
|
-2048 s" Cannot tick compile-only word (try COMP' ... DROP)" rot errstring |
|
-2049 s" Write to broken pipe" rot errstring |
|
|
|
variable next-exception -2050 next-exception ! |
|
|
|
: exception ( addr u -- n ) \ exception- gforth |
|
\G @var{n} is a previously unused @code{throw} value in the range |
|
\G (-4095...-256). Consecutive calls to @code{exception} return |
|
\G consecutive decreasing numbers. Gforth uses the string |
|
\G @var{addr u} as an error message. |
|
next-exception @ errstring |
|
next-exception @ |
|
-1 next-exception +! ; |
|
|
|
-2049 constant broken-pipe-error ( -- n ) \ gforth |
|
\G the error number for a broken pipe |
|
|