Am 30.06.2009 um 22:33 schrieb Markus Winter:
Hi,
I have the following code which jumps over the elseif statement
straight
into the second loop but does not execute it - with CB_Numeric
checked,
StartValue = 10, EndValue = 5, and StepValue = -1 :
No, there is no bug. We've had a discussion about for-loops a while
back here. Basically a negative step value reverses the 'to' and the
'downto' keywords.
So the two for-loops are the same:
for i = 10 to 5 step -1
for i = 10 downto 5 step 1
As are these two:
for i = 5 to 10 step 1
for i = 5 downto 10 step -1
So the second for-loop in your example translates to:
for i = 10 to 5 step 1
And of course the debugger will not enter the loop, because the start
value is already bigger than the end value.
Gruß
Christian
----------------------------------------
Christian Dorn
realbasic {a} online.de
REALbasic 2008.5-1 Pro
REALbasic 2009.2-1 Studio
iMac 3.06 GHz Intel Core 2 Duo, 4 GB RAM
PowerMac G5 2x2GHz, 1.5 GB RAM
Mac OS X 10.5.6
----------------------------------------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|