author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 29 Sep 2011 16:44:37 +0100 | |
branch | jv |
changeset 17869 | 9610c6c94e71 |
parent 17846 | 24edc476ac18 |
child 17892 | d86c8bd5ece3 |
permissions | -rw-r--r-- |
7585 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5947 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
14 |
DomainError subclass:#ZeroDivide |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
6218 | 18 |
category:'Kernel-Exceptions-Errors' |
5947 | 19 |
! |
20 |
||
6218 | 21 |
!ZeroDivide class methodsFor:'documentation'! |
22 |
||
7585 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
6218 | 37 |
documentation |
38 |
" |
|
39 |
Raised when a division by zero is attempted. |
|
40 |
" |
|
7584 | 41 |
! |
42 |
||
43 |
examples |
|
44 |
" |
|
45 |
the following leads into a debugger: |
|
46 |
[exBegin] |
|
47 |
|divisor| |
|
48 |
||
49 |
divisor := 0. |
|
50 |
Transcript showCR: ( 5 / divisor ). |
|
51 |
[exEnd] |
|
52 |
||
53 |
||
10273
84eddf61acc5
Fix spelling in example comment
Stefan Vogel <sv@exept.de>
parents:
7585
diff
changeset
|
54 |
the following does NOT lead into a debugger: |
7584 | 55 |
[exBegin] |
56 |
|divisor| |
|
57 |
||
58 |
divisor := 0. |
|
59 |
[ |
|
60 |
Transcript showCR: ( 5 / divisor ). |
|
10273
84eddf61acc5
Fix spelling in example comment
Stefan Vogel <sv@exept.de>
parents:
7585
diff
changeset
|
61 |
] on:ZeroDivide do:[ |
84eddf61acc5
Fix spelling in example comment
Stefan Vogel <sv@exept.de>
parents:
7585
diff
changeset
|
62 |
Transcript flash. |
84eddf61acc5
Fix spelling in example comment
Stefan Vogel <sv@exept.de>
parents:
7585
diff
changeset
|
63 |
] |
7584 | 64 |
[exEnd] |
65 |
" |
|
6218 | 66 |
! ! |
5947 | 67 |
|
6690
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
68 |
!ZeroDivide class methodsFor:'initialization'! |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
69 |
|
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
70 |
initialize |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
71 |
NotifierString := 'division by zero'. |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
72 |
! ! |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
73 |
|
5947 | 74 |
!ZeroDivide methodsFor:'accessing'! |
75 |
||
76 |
dividend |
|
77 |
"Return the number that was being divided by zero." |
|
78 |
||
5969 | 79 |
^ parameter receiver |
5947 | 80 |
|
81 |
" |
|
82 |
|a b| |
|
83 |
||
84 |
a := 5. |
|
85 |
b := 0. |
|
86 |
Integer divisionByZeroSignal handle:[:ex | |
|
5969 | 87 |
Transcript showCR:('division by zero - dividend was: ' , ex dividend printString) |
5947 | 88 |
] do:[ |
89 |
a // b |
|
90 |
] |
|
91 |
" |
|
92 |
! ! |
|
93 |
||
94 |
!ZeroDivide class methodsFor:'documentation'! |
|
95 |
||
96 |
version |
|
17869 | 97 |
^ '$Id: ZeroDivide.st 10700 2011-09-29 15:44:37Z vranyj1 $' |
17761
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
98 |
! |
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
99 |
|
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
100 |
version_SVN |
17869 | 101 |
^ '$Id: ZeroDivide.st 10700 2011-09-29 15:44:37Z vranyj1 $' |
5947 | 102 |
! ! |
7584 | 103 |
|
17846 | 104 |
ZeroDivide initialize! |