DOWNTO, Help file

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

DOWNTO, Help file

Post by olzeke51 »

Hello Basicchip,
I was using the FOR/DOWNTO/NEXT routine.
Per the STEP information:
If no STEP value is specified in the FOR loop the default of 1 is used.
So I didn't put in a value for the DOWNTO /STEP value - and program doesn't run
Would recommend that on the DOWNTO help file that it be stressed to put in a (positive) value.
BTW, Your official example does have a value.
Thanks for listening,
Gary Olzeke
downto_err.jpg (123.08 KiB) Viewed 808 times

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

Re: DOWNTO, Help file

Post by basicchip »

STEP is an optional keyword in FOR statements, true of all BASICs I have seen. If you have a STEP in the statement the compiler expects a value, and in your case the compiler flags it as an error

If there is no STEP keyword then 1 is assumed.

Code: Select all

FOR i = 3 DOWNTO 0
would be the proper syntax

Post Reply