the chode,
A function can hold a set of calculations, or executions, which will be used over and over within or throughout a program.
a# = 2
b# = 4
repeat
REM << send to and receive values from function
a# = getnewnumber(a#,20)
print "a# = ",a#
b# = getnewnumber(b#,10)
print "b# = ",b#
until mouseclick() > 0
end
REM << the function[must go at end of all your code]
getnewnumber(letter#,value#)
letter# = letter# + value#
endfunction letter#
In the snippet above, the program uses one function to create multiple values, itself having been given values. It then returns the values. After some mindjogging and experimenting, you will learn that functions are extremely valuble and useful, and that they are very efficient! They save on much space and much typing.
+NanoBrain+