mAtboisLim
Member
I'm confussed about how to return values from a function, using psuedocode, because it isn't really defined anywhere by the Board of Studies.
Is the following, shorter method okay:
OR do you have to create another variable in the mainline (e.g answers below), to store the return value of the function:
Is the following, shorter method okay:
Code:
BEGIN MAINPROGRAM
[U]GetAnswer[/U] (Value1, Value2)
Print Answer
Print Answer2
END MAIN PROGRAM
BEGIN [U]GetAnswer[/U] (Value1, Value2)
....(some processing)
Return Answer, Answer2
END [U]Get Answer[/U]
Code:
BEGIN MAINPROGRAM
[B]Answers = [/B] [U]GetAnswer[/U] (Value1, Value2)
Print Answers.Answer1
Print Answers.Answer2
END MAIN PROGRAM
BEGIN [U]GetAnswer[/U] (Value1, Value2)
....(some processing)
Answers.Answer1 = (some value)
Answers.Answer2 = (some value)
Return Answers
END [U]Get Answer[/U]
Last edited: