GOSUB and SCREEN

Fairlight fairlite at fairlite.com
Fri Feb 17 12:32:11 PST 2006


This public service announcement was brought to you by Tyler:
> 
> The non-returning culprit was a subroutine that had a SCREEN command before
> the return.  This sub was called from input processing wef/wlf routines.
> This caused a slow build up of non-returned gosubs in filePro's gosub
> counter.  Does the screen command not clear out the gosub counter/stack when
> the gosubs are called in the wef/wlf processing and wef/wlf processing
> ends?  I would think it should:

The question is, if you're going to SCREEN, and you self-admittedly know
that SCREEN acts as a de facto END, why are you putting it in a GOSUBed
routine at all?  The only reason I can think of is if the screen switching
is conditional.  If it's not conditional, it sounds like it's poorly
planned.

The easy (and sane) solution is that, if the logic deciding that you should
use SCREEN -must- be in a GOSUB routine, set a flag variable in that
routine and check for it immediately after the RETURN.  QED.  One extra
line of code, and one changed one.

mark->


More information about the Filepro-list mailing list