Computer Science Canada info in procedures |
Author: | Legionoflight [ Tue May 31, 2005 7:35 pm ] |
Post subject: | info in procedures |
I am sorry for making so many topics....but... anyways..i was wondering how you could trasfer info from inside one procedure to antoher For exmple. I figured out a score in procedure A. However, when i try to use the same variable for the score in procedure B, it does not reconize it and says it is not delcared." My question is...what could i use to transfer my score from one proc to antoher? |
Author: | wtd [ Tue May 31, 2005 7:42 pm ] | ||||
Post subject: | |||||
Declare the variable outside the procedure.
But, this is just silly. Instead, you should use functions, which can calculate some new value, and return it to the program. You can then do whatever you want with that value.
|
Author: | Legionoflight [ Tue May 31, 2005 8:17 pm ] |
Post subject: | |
Is it the same for int? |
Author: | wtd [ Tue May 31, 2005 10:28 pm ] | ||
Post subject: | |||
Legionoflight wrote: Is it the same for int?
Essentially yes.
Of course, yours would likely be more sophisticated. |