I thought it was a code optimisation post.
I write glcd gcb graphics programs and "the need for speed" is important for the visuals.
I do not use logical if x=1 and y=2 then as it tests both conditions even if x<>1.
If you want to see my point, look at my pong code. More multiple if thens than you could wave a stick at.
Obvious things for moving graphics is don't erase, then do calculations for new then plot,print,draw whatever....do the calcs first as more variables so erasing and redrawing are faster.
I noticed goto instruction used and it can be hard to make an alternative that is as efficient.
edit- it's called structured programing.... ie easier to understandable code?
I have found goto the fastest and mem use best but it's not just frowned about it's not allowed in gcb projects.
Well there's goto used in the glcb libs...I was going to mention it but..
'''Displays a character in a larger fontSubDrawBigChar(InCharLocXasWord, InCharLocYasWord, InCharCode, OptionalInColorasword=GLCDForeground)DimLocX , LocYasWordifCharCode<=126ThenCharCode-=32GotoTablesendififCharCode<=210ThenCharCode-=33GotoTablesendififCharCode<=250ThenCharCode-=34GotoTablesendif
so there :)
Last edit: stan cartwright 2020-01-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I thought it was a code optimisation post.
I write glcd gcb graphics programs and "the need for speed" is important for the visuals.
I do not use logical if x=1 and y=2 then as it tests both conditions even if x<>1.
If you want to see my point, look at my pong code. More multiple if thens than you could wave a stick at.
Obvious things for moving graphics is don't erase, then do calculations for new then plot,print,draw whatever....do the calcs first as more variables so erasing and redrawing are faster.
I noticed goto instruction used and it can be hard to make an alternative that is as efficient.
edit- it's called structured programing.... ie easier to understandable code?
I have found goto the fastest and mem use best but it's not just frowned about it's not allowed in gcb projects.
Well there's goto used in the glcb libs...I was going to mention it but..
so there :)
Last edit: stan cartwright 2020-01-02
Thank you all for the suggestions! I'll keep that in mind when I upgrade code for the charger again. Now it performs its functions :)