This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
-
Nimos
- Halfop
- Posts: 80
- Joined: Sun Apr 20, 2008 9:58 am
Post
by Nimos »
how can I set what a proc gives back after ending?
e.g.
set something [some.proc here]
how can i choose what [some.proc] is?
-
Sir_Fz
- Revered One
- Posts: 3794
- Joined: Sun Apr 27, 2003 3:10 pm
- Location: Lebanon
-
Contact:
Post
by Sir_Fz »
To control what you want a procedure to return, use the [return] command. Example:
Code: Select all
proc whatever {a b c} {
return "returns a string"
}
this will return a string containing "returns a string." Anything after the return statement is ignored.