usage of def fn in basic

Post Reply
Crayon21
Posts: 133
Joined: Sun Nov 04, 2018 2:33 am

usage of def fn in basic

Post by Crayon21 » Tue Nov 26, 2019 12:25 am

can it be used for graphics?
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o

User avatar
XavSnap
Posts: 784
Joined: Sat May 10, 2008 4:23 pm

Re: usage of def fn in basic

Post by XavSnap » Tue Nov 26, 2019 9:49 am

Hi Crayon21,
Yes, but only with a numérique defined value…

10 DEF FN X=INT(a/2)
20 DEF FN Y=INT(b/2)

10 LET x=0: LET y=0: LET a=10
20 DEF FN p(x,y)=a+x
30 DEF FN q()=a+x*y
40 PRINT FN p(2,3),FN q()
RTFM > http://www.worldofspectrum.org/ZXBasicM ... chap9.html

Post Reply