proc command defines a procedure:
Procedures behave just like built-in commands:
Arguments can have defaults:
proc decr {x {y 1}} { expr $x - $y }
Scoping: local and global variables.
sub1 3 2
proc sub1 x {expr $x - 1}
name list of argument names body
Previous slide | Next slide | Back to the index | View Graphic Version |
No notes for slide 13