Removing the need for RETURN

Started by xlar54, November 07, 2008, 03:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xlar54

Reposted here as its a "trick":

I found this from the Ahoy May 87 issue:

1 REM C64 version
2 FOR J = 679 TO 679+22:READA:POKEJ,A:NEXTJ:END
3 DATA 104,104,169,255,133,74,32,138,163,154,201,141
4 DATA 240,3,76,224,168,104,104,104,104,104,96

1 REM C128 version
2 FOR J = 4864 TO 4864+23:READA:POKEJ,A:NEXTJ:END
3 DATA 104,104,104,104,169,141,32,170,79,240,5,162
4 DATA 12,76,60,77,32,80,80,160,5,76,89,80

To demonstrate how to get out of requiring a RETURN statement, after you run one of the above, try this:

10 GOSUB 20
20 A=A+1:PRINT A:SYS 679:GOTO 10

(substitute 4864 if using a 128).  What youll find instead of an out of memory error, is that the need for a RETURN has been removed from the stack.