Yes, that one. Thank you.Are you talking about the For/Next loop?
Step -1 will decrement by 1.
It's not terribly clear in the online Manual but is mentioned in the For/Next section.
A tinkering with the text would make it clearer.
Wow, this shows how far Manual 2 is getting left behind from the on-line syntax guide; never having heard the "downto" syntax I searched the manuals in vain but there it is in the on-line guide, making me wonder what else I am missing. I know that we are probably waiting for some PICAXE editor upgrades with increased functionality, but I really look forward to having a full .PDF of the new software documentation. The four existing volumes are simply excellent but are so in need of an update. Given Technical's track record I guess that we will be kept waiting but the waiting will be worthwhile for the end product! Can we anticipate any Christmas presents?for b1 = 40 to 0 step -1
or
for b1 = 40 downto 0
both do the same thing, take your pick.
Really ?Wow, this shows how far Manual 2 is getting left behind from the on-line syntax guide; never having heard the "downto" syntax I searched the manuals in vain but there it is in the on-line guide, making me wonder what else I am missing. I know that we are probably waiting for some PICAXE editor upgrades with increased functionality, but I really look forward to having a full .PDF of the new software documentation. The four existing volumes are simply excellent but are so in need of an update. Given Technical's track record I guess that we will be kept waiting but the waiting will be worthwhile for the end product! Can we anticipate any Christmas presents?
FOR b0 = 0 TO 10
b1 = b0//2
IF b1 IS ON THEN
SERTXD ("ON",cr,lf)
ELSE
SERTXD ("OFF",cr,lf)
ENDIF
NEXT b0
b10 = 40
Do
<insert your code here>
Dec b10
Loop Until b10 = 0
<more code>
[color=Purple]b10 [/color][color=DarkCyan]= [/color][color=Navy]40
[/color][color=Blue]do
[/color][color=Green]'do sutff here
[/color][color=Blue]dec [/color][color=Purple]b10
[/color][color=Blue]if [/color][color=Purple]b10 [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]then exit
loop[/color]
Yes, as Allycat indicates, I think that you are missing the point; I was highlighting there appears to be a new reserved word here providing a new syntax that is not documented in the printed manual; DOWNTO. The fact that you have missed it is in itself interesting in that I think that the deviation from the "standard" form of BASIC was so unexpected that you quite understandably read right past it. Alan also makes a useful observation that it has not previously been flagged up as a reserved word and the logical derivative UPTO does not seem to exist.Really ?
Manual 2, available from within the editor and without the need to be 'online" seems to have all the details;
Dippy, it was my lack of clarity here when referring to the "on-line guide" - I meant the pull-down list of BASIC Commands that appears above in the header of this forum.And I'd never heard of DOWNTO either... I couldn't find it in the online Manual.
Appendix 2 of the Command Manual provides a list of secondary reserved words. But, umm, DownTo doesn't crack a mention there, either.Rather importantly though, I think that a revised list of Reserved Words should be published as soon as possible.