Hello All, Please help me out. I want to make the specific attribute value like Object Heading into Bold and Italics. This is my code, but I am unable to change the font within the module.
Module m = current
Object obj
string strObject = ""
for obj in m do
{
strObject = obj."Abbreviation"
print strObject "\n"
obj."Object Heading" = strObject
print "Success copied the text to the string\n"
}
Here I want to make the obj."Object Heading" as bold and italics. How to do it? I referred and tried DXL manual, but unfortunately I am getting errors.
KBSri - Wed Mar 14 06:09:09 EDT 2018 |
Re: How to make the all the values of specific attribute in BOLD or Italics The general question would be whether you really want to change the value of the attribute or whether bold / heading shall only be displayed. If you really want to change the text, you will have to create an RTF string. See https://www.ibm.com/developerworks/community/forums/html/topic?id=1ff490cb-c380-4790-a3e2-2285e7a152d4 for an example how to set RTF values. See e.g. http://www.pindari.com/rtf1.html for RTF codes. (\b for bold, \i for italics, backslashes must be escaped.) |
Re: How to make the all the values of specific attribute in BOLD or Italics Mike.Scharnow - Wed Mar 14 07:37:28 EDT 2018 The general question would be whether you really want to change the value of the attribute or whether bold / heading shall only be displayed. If you really want to change the text, you will have to create an RTF string. See https://www.ibm.com/developerworks/community/forums/html/topic?id=1ff490cb-c380-4790-a3e2-2285e7a152d4 for an example how to set RTF values. See e.g. http://www.pindari.com/rtf1.html for RTF codes. (\b for bold, \i for italics, backslashes must be escaped.) and please remember that "getting errors" is never a good description when you need detailed help. |
Re: How to make the all the values of specific attribute in BOLD or Italics Mike.Scharnow - Wed Mar 14 07:38:41 EDT 2018 and please remember that "getting errors" is never a good description when you need detailed help. Hello Mike, I want to change the attribute value and also the make the attribute (Object Heading) as bold. I tried incorporating this following example in DXL manual as below
Object o = current
Code:
Module m = current
Object obj
string strObject = ""
for obj in m do
{
strObject = obj."Abbreviation"
print strObject "\n"
obj."Object Heading" = "{\\b strObject }"
print "Success copied the text to the string\n"
}
This copies the value as strObject in all the module objects. But I wanted to copy the attribute values from "Abbreviation" to "Object Heading" and then want to make it BOLD. |
Re: How to make the all the values of specific attribute in BOLD or Italics KBSri - Wed Mar 14 08:54:23 EDT 2018 Hello Mike, I want to change the attribute value and also the make the attribute (Object Heading) as bold. I tried incorporating this following example in DXL manual as below
Object o = current
Code:
Module m = current
Object obj
string strObject = ""
for obj in m do
{
strObject = obj."Abbreviation"
print strObject "\n"
obj."Object Heading" = "{\\b strObject }"
print "Success copied the text to the string\n"
}
This copies the value as strObject in all the module objects. But I wanted to copy the attribute values from "Abbreviation" to "Object Heading" and then want to make it BOLD. In DXL, strings and variable contents are connected by the <blank> operator. There is no string interpolation in DOORS. string a = "Hi" " " "there" // -> Hi there string b = a ", Joe" // -> Hi there, Joe string c = "Well, " b "." // -> Well, Hi there, Joe. string strObject = "some great content" obj."Object Heading" = richText "{\\b " strObject "}"
|
Re: How to make the all the values of specific attribute in BOLD or Italics Mike.Scharnow - Wed Mar 14 09:49:34 EDT 2018 In DXL, strings and variable contents are connected by the <blank> operator. There is no string interpolation in DOORS. string a = "Hi" " " "there" // -> Hi there string b = a ", Joe" // -> Hi there, Joe string c = "Well, " b "." // -> Well, Hi there, Joe. string strObject = "some great content" obj."Object Heading" = richText "{\\b " strObject "}"
Thanks a lot Mike! |