That's right, looks can be deceiving.
I did a couple tests with Darrel's "How much code could a code hog ...." thread at
http://www.picbasic.co.uk/forum/showthread.php?t=2418
This was done with a 18F chip:
it turns out that both lines use the same amount of space:
Code:
Lcdout $fe, ($c0 +4),"98.7"
LCDOUT $fe, ($c0 +4), #TempTens, #TempUnits,".",#TempDecimals
And, if you use the gosub (in post #5) 3 times, rather than use the above line (three times), you will use about 2/3 the code space. And that's not considering forming the data into a string.
Bookmarks