Re: CLR & RETURN in BASIC subroutines



On Aug 11, 3:53 pm, jeffob2008 <jeffobourd...@xxxxxxxxx> wrote:
On Aug 10, 11:23 am, rusure <r_u_s...@xxxxxxxxxxxxxxx> wrote:

My C64 subroutine contains a CLR operation.  The
RETUR fails with a RETURN without a GOSUB
diagnostic,  Is this what's supposed to happen?

Yup, I believe it was because your CLR destroys your GOSUB marker you
setup prior.....if there are only a few variables to reset or CLeaR,
reset them with the syntax <VARIABLE>=0 or <VARIABLE>="", or make them
equal a value that manually CLeaRs them out; that way your GOSUB
marker stays intact and flow continues properly.

I was just trying to see what CLR does to system parameters under
different situations. Thats why I put the CLR statement with a print
of those parameters in a subroutine. I didn't expect my subroutine to
bomb out when a return was attempted.

.