STEP -1 error

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

STEP -1 error

Post by olzeke51 »

in a FOR/NEXT loop ; the STEP -1 option is not working
ARMbasic[9.37m BT[6.04d] Stamp kernel[8.38c]
'
neg_step_error.jpg
neg_step_error.jpg (174.18 KiB) Viewed 9685 times



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: STEP -1 error

Post by basicchip »

It is actually a documentation error. STEP is in the index but not table of contents til now, when it is that way the CHM editor doesn't have access to it, meaning I don't see it in the CHM editor.

I have fixed the STEP help page and added it into the table of contents under FOR..NEXT

The proper syntax to count down is

Code: Select all

FOR i = 10 DOWNTO 1
...
next
The reason it has to be that way is, when FOR i = x to y. The compiler doesn't know when to end with variables, as should it compare i>y or i<y

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: STEP -1 error

Post by olzeke51 »

Thanks for the clarification - solved my DICE-r project issue !!
BTW-
next time you are in the online help - there is another STEP reference to amend [IMO]
Contents / The Language / Alphabetical KEYWORDS / STEP -- no reference to DOWNTO

Post Reply