Bug #281
closed
Creating a Procedure with a Return Value
Added by Baptiste Pillot over 4 years ago.
Updated about 4 years ago.
Description
Some examples in documentation Procedures.pdf do not work :
This one works
HELLO["aa"]
Procedure HELLO[a$]
Print "Hello, I am a procedure ! " + a$
End Proc
But this one, with a return value, does not :
Print HELLO["one"]
Procedure HELLO[a$]
Print a$
End Proc[a$+a$]
main.aoz:1:12: error: Syntax error
Files
That's because it's bad code. Should be:-
HELLO["one"]
Print Param$
Procedure HELLO[a$]
Print a$
End Proc[a$+a$]
Problem still exists in 0.9.6.
No, it's not bad code. According to the AOZ documentation, The example Baptiste gave should work.
See the Procedures.pdf (attached) for details. Search for the heading " Returning values from a procedure ".
NOTE: The old method using Param, Param$, Param#, etc. is still supported as well.
- Status changed from New to Resolved
- Target version set to 0.9.8.1
Please don't fight! :) It was a bug of mine, and both syntax are correct now...
- Status changed from Resolved to Closed
Re-tested in 0.9.9.4 RC1.
It still works!
Also available in: Atom
PDF