| View previous topic :: View next topic |
| Author |
Message |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Sat Oct 25, 2008 6:39 am Post subject: Giving back a Value |
|
|
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? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Oct 25, 2008 7:26 am Post subject: |
|
|
To control what you want a procedure to return, use the [return] command. Example:
| Code: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|