Is it possible to perform bolding of the whole sentence in an object. For example, the object will contain the below mentioned text
2. Wait 3 seconds for the Relays to Reset.
2. Wait 3 seconds for the Relays to Reset.
2. Wait 3 seconds for the Relays to Reset. " I would like to bold the sentence which contain the text Test Case #, that is basically which starts with the string "#" and ends with the string ":" So I wrote the script, but it is not able to perform the required operation. But i'm unable to get the thing working. Can someone help me where I made a mistake... Module m = current Object o = current int len = 0 int offset = 0 void richtext_line(string tmp_text, string tmp_text1){ Buffer bodyText = create() Buffer newText = create() Buffer tempText = create() newText = "" bodyText = richTextWithOle o."Object Text" print tempStringOf bodyText "\n" //newText = "{\\b " bodyText "}" int len1 = 0 int offset1 = 0 string extract_line = "" findRichText(tempStringOf bodyText, tmp_text, offset, len, false) tempText = bodyTextoffset1+1: findRichText(tempStringOf tempText, tmp_text1, offset1, len1, false) print offset "\n" print offset1 "\n" print len "\n" print len1 "\n" combine(newText, bodyText, 0, offset-1) extract_line = bodyTextoffset:offset + offset1 //extract_line = tempText:len1 newText += "{\\b " extract_line "}" bodyText = bodyTextoffset1+1: //bodyText = tempTextlen1+1: combine (newText, bodyText, 0) /*while ((findRichText(tempStringOf bodyText, tmp_text, offset, len, false)) && (offset > 0)) { combine (newText, bodyText, 0, offset-1) newText += "{\\b " tmp_text "}" //combine (newText, bodyText, offset+len) bodyText = bodyTextoffset+len: } offset = 0 combine (newText, bodyText, 0)*/ print tempStringOf newText "\n" o."Object Text" = richText tempStringOf newText delete newText delete bodyText delete tempText } richtext_line("#", ":") Lion29 - Fri Feb 08 08:31:28 EST 2013 |
Re: Rich Text Formatting
Lion,
richtext_line("HSIT", ":")
2. You have a line where you use the wrong offset variable tempText = bodyText[offset1+1:] Should be: tempText = bodyText[offset+1:] or better combine(tempText, bodyText, offset+1)
|