Turning Tracing On and Off

Example

We will use the following code for our trace examples:

func()
begin
   local j := self.title;
   :Bar();
   :Foo();
end
With trace set to 'functions, the Inspector prints (along with quite a bit of other information)

   Sending Bar(5) to #4410D81
   => 1
   Sending Foo() to #4410D81
   => NIL
=> NIL
As you can see, the Inspector displays the message name, parameters, the object getting the message, and the return result. The final line shows the return result of the entire function.

As you would expect, with trace set to true, the Inspector prints more:

get #4412199 / #60084DC5.title = #600850A5
            Sending Bar(5) to #4412199
            => 1
            Sending Foo() to #4412199
            => NIL
        => NIL
The get line signifies an access to a slot. The number before / is the address of the frame where the search begins (self in this case). The number just after / is the address of the frame in which the slot was actually found (they might well be different due to inheritance). The value found in the slot follows the =. The format, therefore, is:

get frameSearched / frameSlotFoundIn.slotName = slotValue

An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996