
-----------------------------------
josh
Mon Apr 12, 2004 9:06 am

colouring a single word
-----------------------------------
How do you make it so that one word in a sentance is differnt than the next?


colour(10)

put "bob went to the house."



How would I make the word "went" a different colour than the rest of the sentance?

-----------------------------------
Raugrist
Mon Apr 12, 2004 9:22 am

Re: colouring a single word
-----------------------------------
How do you make it so that one word in a sentance is differnt than the next?


colour(10)

put "bob went to the house."



How would I make the word "went" a different colour than the rest of the sentance?
Like this pretty much:

colour (10)
put "bob "..
colour (11)
put "went "..
colour (12)
put "to "..
colour (13)
put "the "..
colour (14)
put "house"

Which sucks pretty much. You could also (maybe) split the setence up into an array where each cell is a word, but that's pretty ugly. But why do you want each word in a sentence to be a different colour? That could have a really ugly look.

-----------------------------------
Paul
Mon Apr 12, 2004 9:23 am


-----------------------------------
put "bob"..
colour(10)put" went".. 
colour (1)put " to the house."

-----------------------------------
josh
Mon Apr 12, 2004 9:50 am


-----------------------------------
kk thanx I jsut want to colour one word in a sentancde like bolding it to make it stand out.

-----------------------------------
Delos
Tue Apr 13, 2004 4:36 pm


-----------------------------------

var sentance : string := "bob went to look for colours"
var key : string := "went"

colour (7)
put sentance (1..index(sentance, key)-1)..
colour (12)
put sentance (index(sentance, key)..index(sentance, key) + length(key))..
colour (7)
put sentance (index(sentance, key) + length(key) + 1..*)


Will only work for one incidence of 'key'.

-----------------------------------
josh
Tue Apr 13, 2004 4:47 pm


-----------------------------------
that seems like alot of work to just bold one owrd, but thanx for the sugestion. I already did it the other way and it worked.
