Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Negative STEP does not work (*solved*)
boriel Wrote:Hmmm. Every if should be closed with END IF, so another END IF is missing in your code. Try this way:
if x=1 then
  print "1"
  if x=0 then
     print "0"
   end if
end if
Maybe you were expecting to use ElseIf which has the same syntax you expected. I'll see if I can change the grammar to include it. Wink

In fact I tried ELSEIF too, but it was not working too (I prefer Syntax like ELSEIF or ENDIF much more than ELSE IF or END IF), but you are absolutly right, I was expecting, it works like you displayed in the link, where only one ENDIF is needed for one IF...THEN...ELSEIF...ELSE...ENDIF block

Quote:Yes, I also find out yesterday. Will be fixed in 1.1.2.

Quote: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
Oops! :? This is very important. I will check this immediately.
Quote:The compiler is otherwise fantastic! Please continue your great work!
Thanks a lot for your feedback :!: I will replay when this is Fixed (ASAP).
By the way, version 1.1.1 is out. I suggest you to try it and check if this bug is still there, because I fixed many things.
Just downloaded the new version.
This loop works still only with Byte or Float definition for x, and not with ubyte, integer, uinteger, long or ulong. I guess unsigned types are not suitable for negative steps even if the value does not reach negative numbers.

BTW: does Memory Allocation mean, it will utilise 128K Spectrum (Maybe later SAM Coupé) memory one day?
------------------------------------------------------------ redirector is dead
Visit my home page!

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)