Nested Gosubs
John Esak
john at valar.com
Sun Oct 31 12:14:54 PST 2004
> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of Fairlight
> Sent: Sunday, October 31, 2004 12:24 PM
> To: 'filePro mailing list'
> Subject: Re: Nested Gosubs
>
>
> When asked his whereabouts on Sun, Oct 31, 2004 at 08:39:41AM -0500,
> Nancy Palmquist took the fifth, drank it, and then slurred:
> >
> > WHEN processing can cause this to be hit also. Be careful when you use
> > a gosub in a when process that the subroutine does not cause
> the WHEN to
> > end by using a SCREEN (most likely) command. It will leave your GOSUB
> > active and the logic following the SCREEN undone.
>
> Can you clarify that point, Nancy? I read it three times, and I'm still
> not "getting it" entirely. I get the fact there's a gotcha, but
> the actual
> specifics are something I'm having trouble nailing down from what you
> cited. For instance, there's no WHEN command, AFAIK. I'm not sure what
> you're saying.
>
> Thanks,
>
> mark->
I certainly don't need to answer for Nancy, but she hasn't so far, so I'll
add to what she's saying. First of all she is using WHEN processing to refer
to all @wlf and @wef (when leaving field, when enetering field) processing.
This is processing triggered by the cursor doing either of the following.
Once the trigger processing begins running, it is not "ended" until it hits
one of four specific commands, END, SCREEN, SKIP, and RESTART. (I suppose
you could consider EXIT a legal "ending" to WHEN processing, but that begs
the question.) Anyway, what Nancy meant, I think, is imagine if you were to
do this, you would juke the GOSUB and the WHEN processing... because you
would be ending the WHEN processig without having hit a RETURN... thus ou
would still be essentially inside a GOSUB routine by filePro's lights.
@wlf22 if:
then: gosub here; end
@wlf23 if:
then: 3=27 * "4.5"; display
if:
then: screen ,4
here if:
then: 19=bal(27)+bal(28)
if: 19 lt "1000"
then: screen ,5
This would, of course, be bad. She is really saying... "Never do a GOSUB
that doesn't RETURN before it gives back control to the user.
John
More information about the Filepro-list
mailing list