On 24/02/2012 07:38, Norman Dunbar wrote:
Morning Steve,

On 23/02/12 20:56, Stephen Usher wrote:
I've put a PDF of my current thoughts about syntax on my web site:

Quick question. FOR lops. I read that "If the TO or UNTIL expression
evaluates to zero at the time of loop entry the commands within the loop
do not get run." which makes me think that the following is a non-loop:

FOR x = 10 TO 0 STEP -1 .... NEXT x

I think it should read "If the WHILE expression evaluates to zero, or
the current value is equal to the TO value, on entry ...".

Thanks. I'll re-word it!

What I was trying to say that if the test expression evaluates to zero upon entry to the loop the loop contents do not get executed. In the "FOR assignment TO loop-variable-target-expression STEP expression" version the implicit test is "is the loop variable not equal to the value of the target expression?".

Steve
--
---------------------------------------------------------------------------
Nostalgia isn't as good as it used to be.

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to