Page 1 of 1

DOWNTO, Help file

Posted: Sun Nov 20, 2022 7:26 pm
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

Re: DOWNTO, Help file

Posted: Tue Nov 22, 2022 12:34 pm
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