Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Returning multiple values from the proc

Returning multiple values from the proc

Returning multiple values from the proc


Im beginer in TCL, and I have a problem about returning a several values from the proc. How to do if I have a proc which is executed in another proc in the loop. Simple example is below. And let say that I need every returned value from the second proc.

proc first {arg1 arg2} {
set sum [expr {$arg1+$arg2}]
return $sum

proc second{}{
for {set i 0} {$i < 100} {incr i} {
for {set j 0} {$j <100} {incr j} {
set result [first $i $j]
return $result

I found in this topic:

that i should do it by the list, but if I have a lot of increments in the loop then can I construct a big list? Please help me, or give me some information where I can looking for.

The best regards:)

RE: Returning multiple values from the proc

You can make the list as big as you like (use "lappend").

Bob Rashkin

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close