08-09-2018, 08:08 AM
Alessandro Wrote:Thank you, now it works![]()
On a side note, I thought that functions, being a kind of subroutines (at least that's what I read in the Wiki) should be put at the end of the code, as it was normal with subroutines. (I never mastered the use of functions in Sinclair BASIC to be honest.)
If you need to call a function before implementing it, you can also pre-declare a function (like in C), using DECLARE, followed by the function header:
Code:
DECLARE FUNCTION FASTCALL myRND as Byte
for n = 1 TO 20
print at 2,0; myRND; ",";
next n
stop
FUNCTION FASTCALL myRND As Byte
Asm
ld a, r
and 0x1F
End Asm
END FUNCTION