Error messages and Exception messages are covered
in Chapter 17 of the Course book, but you can expect Error messages
and Exception messages as soon as you start using LearningWorks.
| Error
or Exception Message |
Possible
Cause(s) |
Comments |
| Argument expected-> |
You have omitted an argument in a
keyword message.
missing [ ] |
An earlier method expects an argument.
E.g. Evaluating 2 + in the Workspace would produce this error
The method you used expected a block. i.e. [ ] |
| Attempt to store into Argument |
You cannot assign into a variable which
is an argument of the method |
A NoNo Example.
debit : anAmount "Comment-
anAmount is an argument of keyword method debit" anAmount
:=3 |
| A
flashing GC cursor .
|
Endless loopcaused by a
method that references itself from within the method. .
E.g. If you have a method called, method1. Do NOT use code similar
to, self method1, within the method,
which will cause an endless loop, and if you are not careful a computer
crash. Often the use of super instead of self cures this
problem
Check that whileTrue: methods will iterate towards
a false answer
Check that whileFalse: methods will iterate towards
a true answer
REMEMBER Ctrl + q if this happens.
Then ensure that the method is NOT referenced from within the
method. |
The flashing GC cursor is a fairly
common error, until you know how to avoid it. TMAs are written in
such a way that the student is likely to fall into the "GC"
trap.
To break out of loop. Hold down Ctrl then
press q (or possibly Ctrl + Q)
Other ways of rectifying can result in Loss of your work.
Often occurs when self is used rather than super
The GC Indicates that Garbage Collection is in operation.
Be aware of this from TMA 2 onwards
|
| is not supported
by your model |
|
Answer
to problem |
| My subclass
should have overridden one of my messages |
Using super instead of self |
Chap 21 page 10. Chap
45 page 20 |
| NonBoolean receiver--proceed for
truth |
The receiver should be true (or false). Or an expression
that that relsults in true or false. |
must be true NOT True
|
| Nothing more expected->
|
Missing . (Full stop) or a
full stop where there should not be one |
Look immediately before the
error message. |
| Missing ( Left parentheses |
Look before the error message. |
| Right
parentheses is expected |
Missing ) Right parentheses |
Look before the error message.
The error is often only detected when a full stop is reached |
| someVars's value is never used |
|
A tempary variable has been declared but not used.
A common errer in the development stage of writing a method. |
| Unhandled exception: xxxx
xxxx is a GUI property name |
Missing end "
Misspelling of name. |
Look after the error message.
See Using GUI (Chap 39) Simplified
steps |
| Unhandled exception: Message not understood
#XXX
|
The receiver is not a suitable object
to receive that message.
E.g.
'two' + 1 |
Where XXX is the message and is not in
the protocol of the receiver.
The message XXX is being sent to the WRONG object
two' is a string object, which does NOT have the binary message
+ 1 in its protocol. The number object 2 understands the message
+ 1. |
| Unhandled exception: My subclass should have overridden
one of my messages |
|
A message in in the superclass should have been overridden
in the subclass. The method has not been written and an unacceptable
superclass method is been used. |
| Will not be optimised
|
Missing [ ] |
E.g. using ifTrue: frog1 leftrather than ifTrue: [ frog1 left ] |
Relax in the sun.