Return command
Page 1 of 1

Author:  Palione [ Sat Jul 06, 2013 6:01 pm ]
Post subject:  Return command

re Friday, June 28 timeline 11:00
I'm confused about the addTen int function in this example.

I understand that the function addTen adds 10 to myValue which starts at 30

Points of confusion...
1. What does PASSED TO USE mean? "After we add 10 to the parameter value THAT WAS PASSED TO USE BY TASK MAIN, ...
2. How do we use the Debugger to verify the correct value was returned?
3. It would be helpful to me to have the program steps numbered and show the values of variables and parameter as the program is executed.

How would I run this program to see the results?

Author:  Palione [ Sat Jul 06, 2013 10:05 pm ]
Post subject:  Re: Return command

I just found the tutorial on Debugging Techniques which answered all my questions about how return works and also how to step thru the program. ... iques.html

Author:  rcahoon [ Sun Jul 07, 2013 9:25 pm ]
Post subject:  Re: Return command

Hi Palione,
Glad you answered most of your questions. Not sure if you figured out (1), so here's some explanation:

Functions have parameters (also called arguments) that are used to supply different values to the function from where the function was called. If a value was used as one of a function's parameters, we say that value "was passed" to the function. So "the parameter value that was passed to use by task main" means the value that task main supplied to the function when it called it. You might be getting caught up on the wording, so an equivalent phrase would be "the parameter value that task main passed for the function to use" or "the parameter value that task main passed to the function."


Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group