The speed of execution of any program is not just determined by the power of the microprocessor, but also by how the program is written.
One way of speeding up BASIC programs is to use integer variables instead of floating point variables, this also reduces the memory space required for storage of the variables.
Another aspect is the structure of the program and the way you choose your BASIC keywords. This might have a significant effect on the speed. Of course StrongBS can't do anything about your programming style and will not be able to re-structure a an interpreted BASIC program.
Once a program has been debugged, the final version can be doctored to work much faster. This is where StrongBS comes in. The many options in StrongBS all work towards speeding up your program and reducing its size. StrongBS can improve your program speed by 20% to 30% and reduce it size to 30% - 60% of the original size. A smaller BASIC program allows your program to be very responsive in the desktop environment.
FOR...NEXT
loop instead of a REPEAT...UNTIL
or WHILE...ENDWHILE
.
The FOR...NEXT
loop is much faster.
AND
. Use IF
instead.
For example:
IF D%=15 AND M%=12 AND Y%=1997 THEN PRINT "something"
can be replaced with the faster equivalent:
IF D%=15 IF M%=12 IF Y%=1997 THEN PRINT "something"
For example:
CASE condition% OF
|
In the above example the WHEN 32
is placed first because it is
expected to occur more often than the rest of the conditions.