Runtime errors occur while a program is executing.
In the case of
SuperCollider prints a four-part error notification to the post window. The parts of the notification are ERROR, RECEIVER, ARGS, and CALL STACK, as in
////////////////////////////////////////////////////////////////////////////////////////////////////
The ERROR section explains what went wrong. The RECEIVER section names the class of the object to which the message was sent. The ARGS section says how many arguments were included in the message. Read the CALL STACK from the bottom to the top to see where the error happened. Reading from bottom to top means going from
to
to
to
to
to
which is the first line in the stack.
////////////////////////////////////////////////////////////////////////////////////////////////////
is the mechanism that prints the error notification to the post window. Select it and press cmd-j to see how it works (how it prints the notification).
////////////////////////////////////////////////////////////////////////////////////////////////////
Execute
to create another runtime error message.
////////////////////////////////////////////////////////////////////////////////////////////////////
The ERROR, RECEIVER, ARGS, and CALL STACK headers in the post window explain the problem: Instances of class Char have no knowledge of multiplication.
Here, the variable a is initialized to an integer and the variable b isn't initialized. Multiplying a (the integer 10) by b (nil, the value that SuperCollider uses for uninitialized data) will create a runtime error.
////////////////////////////////////////////////////////////////////////////////////////////////////
The printout shows the code ran successfully until the index, i, reached 3, which is when a * b happened. The ERROR, RECEIVER, ARGS, and CALL STACK headers describe the problem.
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
A value other than true or false in a boolean test, as in
produces
////////////////////////////////////////////////////////////////////////////////////////////////////
Correcting the test clause fixes the problem.
////////////////////////////////////////////////////////////////////////////////////////////////////
Asking for the length of a non-existent file creates a runtime error. The notification shows what went wrong (a C code primitive failed).
////////////////////////////////////////////////////////////////////////////////////////////////////