filePro Quiz
Jay Ashworth
jra at baylink.com
Wed Aug 10 20:58:57 PDT 2011
----- Original Message -----
> From: "George Simon" <george at flowersoftusa.com>
> Which lines would evaluate as TRUE below if the user hits <N> at line
> #1?
Ok: it looks like you posted the same thing 3 times; this is the cleanest
one, so I'll reply here.
────────────────────────────────────────────────────────────────────────────────
> 1 ------- - - - - - - - - - - - - - - - -
> TOP ◄ If: @sk="save" ◄
> Then: input popup yn "Do You Want to Exit? (Y/n) " default "Y" ◄
If the user is ever prompted *to* hit N, we must assume this line was
reached with @SK eq "SAVE", or they wouldn't have been prompted. This
colors all our other answers, but it makes line 1 TRUE.
> 2 ------- - - - - - - - - - - - - - - - -
> ◄ If: @sk="save" and yn ne "N" ◄
> Then: end ◄
Now, we're assuming that this is *one continuous flow of execution*,
so SK again eq "SAVE", and yn eq "N" so this one's FALSE.
> 3 ------- - - - - - - - - - - - - - - - -
> ◄ If: @sk="save" ◄
> Then: screen ,(@fd) ◄
We're still running, @SK still equals "SAVE", since line 2 is contra-factual,
and nearly caught me: line 1's prompt *says* line 2 should have exited,
but never debug the comments or the prompts, only the code... so this is
true, and we go back to the field we presumably hit SAVE in, to return
to *HERE* when we hit SAVE again (unless I badly misremember how SCREEN
works... :-)
> 4 ------- - - - - - - - - - - - - - - - -
> ◄ If: ◄
> Then: end ◄
And what we'll do then is END. Since there's no conditional on line 4.
> 5 ------- - - - - - - - - - - - - - - - -
> @wlf* ◄ If: ◄
> Then: pushkey "[save]" ◄
> 6 ------- - - - - - - - - - - - - - - - -
> ◄ If: ◄
> Then: end ◄
Both of these clearly evaluate to TRUE as well, but I assume what you
really want to know is what will *happen* when this code interacts with
the code above. The answer is, I believe, that the first time you hit it,
you'll start at line 1, and it will trigger again within your SCREEN
statement, at which time, you'll return to line 4, and just END.
Ken? How'd I do? :-)
Cheers,
-- jra
--
Jay R. Ashworth Baylink jra at baylink.com
Designer The Things I Think RFC 2100
Ashworth & Associates http://baylink.pitas.com 2000 Land Rover DII
St Petersburg FL USA http://photo.imageinc.us +1 727 647 1274
More information about the Filepro-list
mailing list