aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/exception.frt
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/lib/exception.frt')
-rw-r--r--amforth-6.5/common/lib/exception.frt15
1 files changed, 15 insertions, 0 deletions
diff --git a/amforth-6.5/common/lib/exception.frt b/amforth-6.5/common/lib/exception.frt
new file mode 100644
index 0000000..d9f7a87
--- /dev/null
+++ b/amforth-6.5/common/lib/exception.frt
@@ -0,0 +1,15 @@
+
+
+\ allocate an exception number
+\ is less than -4096, keeps track in EEPROM
+
+-4096 Evalue exception
+: exception ( -- n ) exception dup 1- to exception ;
+
+\ usage
+\ the code sequence
+\ exception constant !!foo
+\ ... if !!foo throw then ...
+\ prints
+\ ?? -4096
+\ and returns to the command prompt if not catched \ No newline at end of file