forums

TNT Basic Forums > Programming Q&A
hope this helps
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-22-2002 22:00

Posted by:
James Rhodes

Click Here to Email James Rhodes   Find more posts by James Rhodes

' Procedure definition
Procedure Test()
...
End Proc(n)

Returning values from procedures is useful because it is a convenient way of getting a result from a procedure. Only one value can be returned from a procedure. The value you choose to return is specified in the brackets after the End Proc statement.

The procedure Test can change the value of n and return it. This value can then be caught from the point the procedure was called from using the Result command.

Result Int/Result Integer contains the returned value if the value returned was an integer.
Result Float contains the returned value if the value returned was an floating point number.
Result Str/Result String contains the returned value if the value returned was a string.

(...from TNT Basic site)

James

p.s. from what I understand you have to use Result - with Integer, Float or String - depending on datatype passed to procedure. Not sure about when not returning anything to the calling procedure. Any one else know?

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.