FUNC
FUNC foo (a, b)
Declares a function. Return a value by assigning a variable with the same name as the function or by using RETURN.
Example 1:
' Main program
print MyAddFunction(10,20)
' Function definition
FUNC MyAddFunction(a,b)
local c 'c is just known inside this function
c = a + b
MyAddFunction = cEND
Example 2: Using return
' Main program
print MyAddFunction(10,20)
' Function definition
FUNC MyAddFunction(a,b)
local c 'c is just known inside this function
c = a + breturn c
END
Code samples using FUNC
000 hello.bas
001 3 ways to print hello 5 times.bas
002 numeric variables.bas
003 conditional branching.bas
004 loops.bas
005 challenge.bas
006 arrays+.bas
100lines.bas
2048.bas
2048.bas
3d_palmx.bas
7gables.bas
agendus.bas
Another center finder.bas
another look at trig functions.bas
B+B.bas
base64.bas
bb2fork smurf.bas
bezier's autograph book.bas
bezierbounce.bas
biorythms.bas
bopit.bas
bowling7.bas
btn 21.bas
calc.bas
Chaos_1xt.bas
checkers.bas
checkers.bas
chess.bas
Language
AND
AS
BAND
BG
BOR
BYREF
CALL
CASE
CATCH
CONST
DECLARE
DEF
DO
ELIF
ELSE
ELSEIF
END
END TRY
ENDIF
EQV
EXIT
FALSE
FI
FOR
FUNC
GOSUB
GOTO
IF
IFF
IMP
IN
LABEL
LET
LIKE
LOCAL
LSHIFT
MDL
MOD
NAND
NEXT
NOR
NOT
ON
OR
REM
REPEAT
RETURN
RSHIFT
SELECT
STEP
STOP
SUB
THEN
THROW
TO
TRUE
TRY
UNTIL
USE
USG
USING
WEND
WHILE
XNOR
XOR
If there is insufficient information on this page and you wish learn more about FUNC,
please send an email to smallbasic@gmail.com. You can help to improve information about
FUNC by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.