First page Back Continue Last page Overview Graphics

Criando subcomandos (ensemble)

namespace eval ::counter { variable counter 0 namespace export get set incr namespace ensemble create }

proc ::counter::get {} { variable counter return $counter }

proc ::counter::set {value} { variable counter return [::set counter $value] } proc ::counter::incr {{increment 1}} { variable counter return [::incr counter $increment] }