Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
user-defined functions/subroutines
23-04-2016, 05:11 PM
Post: #1
user-defined functions/subroutines
Is it possible to return more than one result from a user-defined function/subroutine? I have been using a vector to return multiple results.

Thanks
Find all posts by this user
Quote this message in a reply
25-04-2016, 07:01 AM
Post: #2
RE: user-defined functions/subroutines
Hello,

Nope, you can only return one 'object'.

Of course, the object can be a list or vector (as you are doing), which solves the problem.

This is what a function (a proper mathematical term) is. Something that takes 0 to n inputs and returns one single output.

Cyrille
Visit this user's website Find all posts by this user
Quote this message in a reply
25-04-2016, 10:58 AM
Post: #3
RE: user-defined functions/subroutines
(25-04-2016 07:01 AM)brebisson Wrote:  Hello,

Nope, you can only return one 'object'.

Of course, the object can be a list or vector (as you are doing), which solves the problem.

This is what a function (a proper mathematical term) is. Something that takes 0 to n inputs and returns one single output.

Cyrille

Thanks
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)