The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistency in RND
#6
Alessandro Wrote:Thank you, now it works Big Grin

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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)