The ultimate_base Utility Procedure

The ultimate_base utility procedure finds the ultimate base class of a class in a single inheritance chain by extracting the structure fields and iterating over the information until it arrives at a class that does not have a base class.

proc ultimate_base {type_id} {
    while {1} {
        set fields [TV::type get $type_id struct_fields]
        set first_member [lindex $fields 0]
        set properties [lindex $first_member 3]
    
        if {[regexp {base class} $properties] == 0} {
            return $type_id
        } else {
            set type_id [lindex $first_member 1]
        }
    }
}
 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0