Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cprint and cfprint text mode routines
#11
(09-23-2023, 08:22 PM)bplus Wrote: Interesting how you did checking on/off with subs!

But you left out comparing to standard way with Color + Locate + Print

I am weighing the cost of extra lines of code for subs and ease of typing one line instead of 3 with standard 3 maybe try good ole CLP sub:

Sub CLP(fg, bg, row, col, text$)
color fg, bg
locate row, col
print text$;
end sub

Remember though, part of the idea here is: "without altering global color values or background colors".

For the "not alter global colors", you could:
OFG = _DEFAULTCOLOR
OBG = _BACKGROUNDCOLOR
....stuff
COLOR OFG, OBG
END SUB

But to maintain background colors, you'd need to get POINT (x, y)....

Which ends up with what's going on in these routines, but with _Mem commands.
Reply


Messages In This Thread
RE: cprint and cfprint text mode routines - by SMcNeill - 09-23-2023, 08:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Text-centring subs PhilOfPerth 3 775 12-20-2024, 02:50 AM
Last Post: Pete
  A scrolling SUB for text in SCREEN 0 TempodiBasic 1 647 12-10-2024, 01:04 AM
Last Post: TempodiBasic
  Reverse search and case-insernsitive search routines TDarcos 6 1,334 04-15-2024, 04:21 AM
Last Post: eoredson
  Text encryption AtomicSlaughter 8 1,663 11-17-2022, 10:58 PM
Last Post: Jack
  Text Mode Drawing Routines James D Jarvis 0 562 10-16-2022, 06:27 PM
Last Post: James D Jarvis

Forum Jump:


Users browsing this thread: 1 Guest(s)