Actions
Bug #281
closedCreating a Procedure with a Return Value
Start date:
03/01/2020
Due date:
% Done:
0%
Estimated time:
Affected version:
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
Updated by David Baldwin almost 5 years ago
That's because it's bad code. Should be:-
HELLO["one"]
Print Param$
Procedure HELLO[a$]
Print a$
End Proc[a$+a$]
Updated by Brian Flanagan almost 5 years ago
- File 3.5._Procedures.pdf 3.5._Procedures.pdf added
- Affected version changed from 0.9.5.1 to 0.9.6
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.
Updated by Francois Lionet over 4 years ago
- 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...
Updated by Brian Flanagan over 4 years ago
- Status changed from Resolved to Closed
Re-tested in 0.9.9.4 RC1.
It still works!
Actions