Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GOTO inside a function question?
#2
(06-05-2021, 03:14 PM)RandomiserUsr Wrote: I have two functions that have a return 0 


Code:
FUNCTION processTest(test INTEGER) as INTEGER

......processing stuff

IF X=1 THEN
   poke TestAddress, 1
   GOTO displayMsg
END IF

return 0
END FUNCTION


Does the this cause any memory leaks on the stack?
i.e. by not "returning" something is left on the stack and won't be removed?

I remember something about GOSUB/RETURN having this or am I okay to not RETURN (I am experimenting before you may say it's not "good practice  Smile    )


Thanks in advance

okay so having changed the code around and no not jumping from a function with a GOTO rather than RETURN, the out of memory errors I was getting have gone.
Reply


Messages In This Thread
RE: GOTO inside a function question? - by RandomiserUsr - 06-05-2021, 09:13 PM
RE: GOTO inside a function question? - by boriel - 06-06-2021, 10:19 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)