Changes

Locomotive BASIC

803 bytes added, 13:22, 21 December 2011
/* FN */
==== <code>FN</code> ====
: [FunctionBASIC 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.8066520 DEF FNgrv=s0+v0*t+0.5*gn*t^230 s0=0:v0=0:t=540 PRINT "...after";t;"seconds your dropped stone falls";FNgrv;"metres"</pre>the results are...<pre>...after 5 seconds ... falls 122.58315 metres</pre>(...as the results)
==== <code>FOR TO STEP NEXT</code> ====
205
edits