Exceptions

Getting the Value of self


GetCurrentReceiver(level);


The value of self may be different for different functions in the stack. To obtain the value of self for a given function, use GetCurrentReceiver. The function takes one parameter, the stack level. As an example, to get the value of self for MethodB in the example stack trace described previously, use

GetCurrentReceiver(2);
#4416225  {_parent: {_parent: {#4411915}, 
                     _proto: {#6006F095}, 
                     viewCObject: 0x1109467, 
                     viewclipper: 17863798, 
                     base: <1>, 
                     viewFlags: 5}, 
           _proto: {buttonClickScript: <function, 0 arg(s)
                    #6006F2D5>, 
                    text: "Button", 
                    viewBounds: {#6006F525}, 
                    MethodC: <function, 2 arg(s) #6006F565>, 
                    MethodD: <function, 0 arg(s) #6006F71D>, 
                    MethodB: <function, 1 arg(s) #6006F825>, 
                    _proto: {@226}}, 
           viewCObject: 0x110AC96, 
           viewFlags: 33554947}

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

Last modified: 1 DEC 1996