The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For loops with type byte (*solved*)
#1
Code:
dim c,b as byte FOR c=1 TO 175 FOR b=1 TO 250 PLOT b,c NEXT b NEXT c

Doesn't seem to work as expected. If I make it a uinteger, it works perfectly. At first I thought it was a problem with 0=256 in a byte the original was
Code:
FOR c=0 TO 175 FOR b=0 TO 255

Which I could see not terminating, since a byte can never get bigger than 255.

However the problem I have with it as written is it's skipping the loop altogether..

1> Would for/next loops with byte be faster? (I'm following the principle of smaller=faster)

2> Why isn't it running the loop?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)