Changes

Jump to: navigation, search

Locomotive BASIC

4 bytes removed, 13:27, 21 December 2011
/* FN */
==== <code>FN</code> ====
: Function
BASIC allows the program to define and use simple value returning functions. DEF FuNction is the definition part of this mechanism and creates program-specific function which works within the program in the same way as a function such a COS operates as a built-in function of BASIC. It may be invoked throughout the program. Variable types must be consistent and the DEF FN command should be written in part of the program outside the execution loop.
Syntax : DEF FN<name>[(<formal parameters>)]=<general expression>
Example:''"with the definition of..."''
<pre>
10 gn=9.80665
40 PRINT "...after";t;"seconds your dropped stone falls";FNgrv;"metres"
</pre>
''"the results are..."''
<pre>
...after 5 seconds ... your dropped stone falls 122.58315 metres
</pre>
(...as the results)
==== <code>FOR TO STEP NEXT</code> ====
205
edits