Format$ - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Prolific Programmers (https://qb64phoenix.com/forum/forumdisplay.php?fid=26) +---- Forum: SMcNeill (https://qb64phoenix.com/forum/forumdisplay.php?fid=29) +---- Thread: Format$ (/showthread.php?tid=2554) |
Format$ - SMcNeill - 03-30-2024 I swear, I'd posted this on the forums before, but I can't find it anymore on here. (Maybe it's on the old forums from way back when?) Anywho, with Rho and Eric both posting their functions to format text in a similar manner to Print Using, I thought I'd share this once again: Code: (Select All)
RE: Format$ - grymmjack - 03-31-2024 You should _FREEIMAGE tempimage somewhere too. I know it's static in the function, but you should maybe document that? Also what screen mode is this using/depending on? RE: Format$ - SMcNeill - 03-31-2024 (03-31-2024, 05:10 PM)grymmjack Wrote: You should _FREEIMAGE tempimage somewhere too. I know it's static in the function, but you should maybe document that? In this case, I just figured it isn't worth the effort or overhead. Our screen here is all of 160 bytes total in size. Why create that, initialize it, free it, when we can just preserve and reuseit? (It's a SCREEN 0 screen, 80 character, 1 row. -NEWIMAGE(80, 1, 0) ) With memory usage this small, why waste cycles freeing it? It preserve and reuse it. RE: Format$ - bplus - 03-31-2024 (03-31-2024, 05:10 PM)grymmjack Wrote: You should _FREEIMAGE tempimage somewhere too. I know it's static in the function, but you should maybe document that? tempimage = _NewImage(80, 1, 0) this shows that it is screen 0 plus that is only screen you can use the Screen function to get letters. ok steve beat to post time btw this was posted on the last forum, thats why it seems like deja vu RE: Format$ - SMcNeill - 03-31-2024 I knew I'd shared it somewhere before! |