Great,... Yes.
IF AND THEN --- compile to 159 words.
Select case --- compile to 58 words.
I will have to compere all statements. eg. FOR/NEXT loops. while/Wend, GOTO, GOSUB/RETURN, HI/LOW, TOGGLE.
For time of Execution speed and code space.
.
Great,... Yes.
IF AND THEN --- compile to 159 words.
Select case --- compile to 58 words.
I will have to compere all statements. eg. FOR/NEXT loops. while/Wend, GOTO, GOSUB/RETURN, HI/LOW, TOGGLE.
For time of Execution speed and code space.
.
while / wend (same as "do / loop" but without a condition) -- will always be faster than "for next loops" Main reason is because there is no counter, there's no constantly incrementing or decrementing after each iteration.
But I encourage you to conduct your tests and post the results here.
Trent Jackson
Another thing also, the "AND" operator -- try to avoid it at all costs.
is much better than ...Code:if b1 = 100 then if b2 = 200 then Thank Mr Jackson for these invaluable tips end if end if
You might save a few bytes of code space, it'll run faster too.Code:if b1 = 100 and b2 = 200 then do something ... end if
Can anyone tell me why?
Trent Jackson
IF you're actually asking a question vs. just talking out your.............................
then...
2 comparisons, 3 jumpsCode:if b1 = 100 then if b2 = 200 then Thank Mr Jackson for these invaluable tips end if end if
3 'nested' comparisons (2 + 1), couple of extra 'state' bits to save in the middle of it all, plus 4 jumpsCode:if b1 = 100 and b2 = 200 then do something ... end if
IF you're posing a question for the class from the podium, then nevermind...
here the 0.3 version.
contains some bug fixes, the most important:
in 0.2 timer values are contained in BYTE VAR, big values could not be showed (in 0.3 WORD type is used).
regards,
hOZONE
Bookmarks