So the way that the Print / Text Commands work., is that they will use the colour set by the Ink command until you next use the command.
As such if you want to output different colours, you HAVE to break up the output string into the colours you want.
Of course what we can do is instead of printing using the Text command the entire String; we instead can output the individual letters.
i.e.
Sync On
Sync Rate 30
myString$ = "This is a sentence that has different colours"
TextWidth = Text Width("A")
Do
Pos = 0
Repeat
Inc Pos, 1
Ink RGB( Rnd( 255 ), Rnd( 255 ), Rnd( 255 ) ), RGB( 0, 0, 0 )
Text TextWidth * (Pos - 1), 0, Mid$( myString$, Pos )
Until Pos = Len(myString$)
Sync
Loop
You don't loose the original String as you can see., but we can still have some fun with the output.
And as we have the TextWidth as a value; we can essentially use the Int( Mouse Position / Text Width ) to then return the Letter Position; so let's say we want to have something similar to Hyperlinks.
Sync On
Sync Rate 60
myString$ = "This is a sentence that has different colours"
Main = RGB( 196, 196, 196 )
Link = RGB( 255, 255, 0 )
LinkStart = 28
LinkEnd = 28 + 10
Do
Cls
Mx = MouseX()
My = MouseY()
Tx = Text Width("A")
Ty = Text Height("A")
Pos = 0
Repeat
Inc Pos, 1
Ink Main, 0
If Mx > LinkStart * Tx And Mx < LinkEnd * Tx And My > 0 And My < Ty
If Pos > LinkStart And Pos < LinkEnd
Ink Link, 0
EndIf
EndIf
Text Tx * (Pos - 1), 0, Mid$( myString$, Pos )
Until Pos = Len(myString$)
Sync
Loop
This is a crude example., but with some time and effort you can refine all of this with Types, Arrays and Functions.
It should give you a good starting point though.