Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Negative STEP does not work (*solved*)
Hi Boriel, I just trying to write some stuff in ZX Basic compiler 1.1.0, but I ran into some problems:
if x=1 then
  print "1"
else if x=0 then
  print "0"
end if

I got the message "Unexpected end of file", so if it is a part of FOR NEXT Loop, I got the message "Unexpected Token 'NEXT' <NEXT>". ELSE alone works, but I was sure, ELSE IF should work too, Or maybe I'm wrong?

Another one: the program does not accept Exponents: 2e4 (=2000) or similar.
And finally:
Negative STEP does not work with integers or long, only with floats or byte:
dim x as integer

for x=7 to 1 step -1
  print x
next x

The compiler is otherwise fantastic! Please continue your great work!
------------------------------------------------------------ redirector is dead
Visit my home page!

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)