#126: tcl function with default arguments
proc add {a {b 5}} {
return [expr $a+$b]
}
puts [add 10 12]
puts [add 12]
Output:
22 17
Last Updated on 2020-10-08 by gantovnik
Oct 8, 2020 | tcl | 0 comments
#126: tcl function with default arguments
proc add {a {b 5}} {
return [expr $a+$b]
}
puts [add 10 12]
puts [add 12]
Output:
22 17
Last Updated on 2020-10-08 by gantovnik
Subscribe now to keep reading and get access to the full archive.
Recent Comments