04-01-2024, 06:04 AM
(04-01-2024, 02:54 AM)eoredson Wrote: The only 2 problems with using the screen is:
1)Have to store/restore area of screen being written to.
2)What if print using output is greater than 80 chars.
Otherwise, yes, screen is more efficient then file access..
Erik.
1) Just make the screen STATIC so you don't need to create/free it over and over. It's only going to be a few hundred bytes of memory in the end, after all.
2) You're going to format a single number to more than 80 characters? That's SOME number!! Even then, the solution is to just be certain you make the screen large enough to hold the value to begin with.
_NEWIMAGE(800,1,0) <-- Is 800 characters enough for you to format your number?
_NEWIMAGE(9999, 1, 0) <--- is 9,999 characters enough? A normal screen 0 screen is 80x25 characters = 4000 -- you've now got over twice that limit!
Just change the size of that _NEWIMAGE so it's large enough to format that value that you want formatted.