Actually, you can type less by eliminating the <font> tags:

put fld 1 into tText
replace "ck" with "<b>ck</b>" in tText
replace "ch" with "<b>ch</b>" in tText
replace "oa" with "<u>ch</u>" in tText
replace "oo" with "<u>oo</u>" in tText


Or in a more generic way -- more code but easier to maintain

put fld 1 into tText
set the caseSensitive to true
put "ck ch" into vChunksToBold
repeat for each word w in vChunksToBold
  replace w with "<b>" & w & "</b>" in tText
end repeat
put "ch oo" into vChunksToUnderline
repeat for each word w in vChunksToUnderline
  replace w with "<u>" & w & "</u>" in tText
end repeat
set the caseSensitive to false
put tText into fld 1

And if think you may need more style in the future, even more generic way would be to use an array

put fld 1 into tText
set the caseSensitive to true
put "ck ch" into vChunksToMark["b"] --  bolds
put "ch oo" into vChunksToMark["u"] --  underlines
repeat for each line k in the keys of vChunksToMark
  put "<" & k & ">" into vMarkBeg
  put "</" & k & ">" into vMarkEnd
  repeat for each word w in vChunksToMark[k]
    replace w with vMarkBeg & w & vMarkEnd in tText
  end repeat
end repeat
set the caseSensitive to false
put tText into fld 1

Robert
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to