Cold Help System: Programming: ColdC Reference Manual: Language Structure: Expressions: Method Call Expression: Overridden Methods


If a method overrides another method defined on an ancestor, the overriding method can call the overridden method using the function pass(). Arguments to pass() are sent to the overridden method as if the method were called normally. The return value of pass() is the normal return value of the overridden method.

For instance, passing to an overridden method with:

pass("this arg", 2);

Would be rougly equivalent to calling the same method, if it was not overridden, with:

obj.method("this arg", 2);

When executed in this manner, the overridden method sees the same object, sender, and caller as the current method.

In the situation where a descendant overrides a method defined on two of its ancestors, you can determine which method is passed to using the function find_next_method(). The following method (assuming a ColdCore database) can also be of use:

arg obj, method;
var trace, current;

current = (> obj.find_method(method) <);
trace = [];
while (current) {
    trace += [current];
    current = (| obj.find_next_method(method, current) |);
}
return trace;


the Cold Dark