Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another hair brain idea
#1
What if the colors could be converted to strings... I know what your thinking .. brilliant idea...

So it would go like this 
$Color:32

Presently it goes like this:
Color Brown
_Uprintstring (C,R)," This is the color brown"
C=C+75
Color Lime
_Uprintstring (C,R)," and now the color is Lime"


But, whatif

Color Brown
Lime$=str$(Color Lime)
_Uprintstring (C,R)," This is the color Brown"+Lime$+" and now the color is Lime"

Easy peasy right.
Reply
#2
(12-04-2025, 06:51 PM)Dimster Wrote: What if the colors could be converted to strings... I know what your thinking .. brilliant idea...

So it would go like this 
$Color:32

Presently it goes like this:
Color Brown
_Uprintstring (C,R)," This is the color brown"
C=C+75
Color Lime
_Uprintstring (C,R)," and now the color is Lime"


But, whatif

Color Brown
Lime$=str$(Color Lime)
_Uprintstring (C,R)," This is the color Brown"+Lime$+" and now the color is Lime"

Easy peasy right.
This isn't exactly the same.  But you MIGHT find this useful.


Attached Files
.bas   TTEST.bas (Size: 189 bytes / Downloads: 18)
.bm   TPRINT.BM (Size: 4.27 KB / Downloads: 18)
.bi   TPRINT.BI (Size: 859 bytes / Downloads: 16)
Reply
#3
Ya ahenry, that's pretty close. I assume that would be screen 0? Pretty neat approach to different color text in the same sentence.
Reply
#4
(12-04-2025, 07:25 PM)Dimster Wrote: Ya ahenry, that's pretty close. I assume that would be screen 0? Pretty neat approach to different color text in the same sentence.

Works on 256 color graphics screens too.  (As long as you haven't messed with the Palette)   Doesn't work right on 32 bit screens.
Reply
#5
(12-04-2025, 07:48 PM)ahenry3068 Wrote:
(12-04-2025, 07:25 PM)Dimster Wrote: Ya ahenry, that's pretty close. I assume that would be screen 0? Pretty neat approach to different color text in the same sentence.

Works on 256 color graphics screens too.  (As long as you haven't messed with the Palette)   Doesn't work right on 32 bit screens.

I'm no expert, but what I do is create a small sub for each colour I want to use, like 
Sub Yellow
Color _RGB(255, 255, 0)
End Sub
then I just plug the word "Yellow" into the line where I want the colour change, like 
Print "HI";:yellow:
Print ", Dimster
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#6
(12-05-2025, 02:10 AM)PhilOfPerth Wrote:
(12-04-2025, 07:48 PM)ahenry3068 Wrote:
(12-04-2025, 07:25 PM)Dimster Wrote: Ya ahenry, that's pretty close. I assume that would be screen 0? Pretty neat approach to different color text in the same sentence.

Works on 256 color graphics screens too.  (As long as you haven't messed with the Palette)   Doesn't work right on 32 bit screens.

I'm no expert, but what I do is create a small sub for each colour I want to use, like 
Sub Yellow
Color _RGB(255, 255, 0)
End Sub
then I just plug the word "Yellow" into the line where I want the colour change, like 
Print "HI";:yellow:
Print ", Dimster
   There are always many ways to Flay a Feline
Reply
#7
Just a small observation: It should be "harebrained" rather than "hair brain"
= "with the brain of a hare" as dopey as a large rabbit

I only found this out a few years ago, but once you know it make sense.
Reply
#8
(12-05-2025, 10:05 AM)Magdha Wrote: Just a small observation: It should be "harebrained" rather than "hair brain"
= "with the brain of a hare" as dopey as a large rabbit

I only found this out a few years ago, but once you know it make sense.

@Magdha Observing on your observation:  "Hairbrained" is also acceptable.  It's even in the dictionary, though with a reference which basically says, "See harebrain".  

Hairbrained has been a historical spelling going back hundreds of years (Historical *misspelling* going back hundreds of years, perhaps??), and it's been around so long and used so much that it's also considered to be a valid word.

https://www.merriam-webster.com/dictionary/hairbrained

I would guess though, if you have hair growing in your brain, you're probably not that much smarter than a hare to begin with.

Just one of those "once you know, you know" points to add to your point.  Big Grin
Reply
#9
Big Grin Big Grin
Reply
#10
I thought hairbrained is when your hair grows the wrong way.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)