Bold Object Heading in DXL column display

I am trying to display the differences using the following script and I would like the Object Heading to be bold as well.  The script is working for me with the exception that it does not display the Object Heading in bold text.  I have tried adding the \\b in numerous locations within the script but have been unsuccessful, what am I missing?

pragma runLim,0
Buffer c = create()
c = obj."BL Object Heading"
Buffer d = create()
d = obj."Object Heading"
Buffer e = create()
e = obj."BL Object Text"
Buffer f = create()
f = obj."Object Text"
if ( length(c) == 0 )
{
     Object o
     string s
     s = probeRichAttr_(obj,"Object Heading", false)
     displayRich s
}else
{
    Buffer resBuf = create
    diff(resBuf, c, d, "\\cf1\\strike ", "\\cf3\\ul ")
    displayRichWithColour (tempStringOf resBuf)
    delete resBuf
}
if ( length(e) == 0 )
{     Object o
     string s
     s = probeRichAttr_(obj,"Object Text", false)
     displayRich  s
} else
{
    Buffer resBuf = create
    diff(resBuf, e, f, "\\cf1\\strike ", "\\cf3\\ul ")
    displayRichWithColour (tempStringOf resBuf)
    delete resBuf
}
delete(c)
delete(d)
delete(e)
delete(f)


PatRoof - Mon Dec 15 08:29:07 EST 2014

Re: Bold Object Heading in DXL column display
llandale - Mon Dec 15 14:34:01 EST 2014

diff() won't work on rich text strings as the rich text tags will be interpreted as raw text.  You'll need to do some VERY clever string substitutions before and after diff() to make that work.

Anyway, try to add bolding after diff(), at least for the Heading comparison:

  • Buffer resBuf1 = create()
  • resBuf1 += "\\b "
  • combine(resBuf1, resBuf, 0)
  • displayRichWithColour(tempStringOf resBuf1)

-Louie

Re: Bold Object Heading in DXL column display
PatRoof - Mon Dec 15 14:59:57 EST 2014

llandale - Mon Dec 15 14:34:01 EST 2014

diff() won't work on rich text strings as the rich text tags will be interpreted as raw text.  You'll need to do some VERY clever string substitutions before and after diff() to make that work.

Anyway, try to add bolding after diff(), at least for the Heading comparison:

  • Buffer resBuf1 = create()
  • resBuf1 += "\\b "
  • combine(resBuf1, resBuf, 0)
  • displayRichWithColour(tempStringOf resBuf1)

-Louie

Thank you Louie

I tried what you suggested (see below) and it didn't work.  Any other suggestions.

 

pragma runLim,0
Buffer c = create()
c = obj."BL Object Heading"
Buffer d = create()
d = obj."Object Heading"
Buffer e = create()
e = obj."BL Object Text"
Buffer f = create()
f = obj."Object Text"
if ( length(c) == 0 )
{
     Object o
     string s
     s = probeRichAttr_(obj,"Object Heading", false)
     displayRich s
}else
{
    Buffer resBuf = create
    diff(resBuf, c, d, "\\cf1\\strike ", "\\cf3\\ul ")
    Buffer resBuf1 = create()
    resBuf1 += "\\b "
    combine (resBuf1, resBuf,0)
    displayRichWithColour (tempStringOf resBuf1)
    delete resBuf
    delete resBuf1
}
if ( length(e) == 0 )
{    Object o
     string s
     s = probeRichAttr_(obj,"Object Text", false)
     displayRich  s
} else
{
    Buffer resBuf = create
    diff(resBuf, e, f, "\\cf1\\strike ", "\\cf3\\ul ")
    displayRichWithColour (tempStringOf resBuf)
    delete resBuf
}
delete(c)
delete(d)
delete(e)
delete(f)

Re: Bold Object Heading in DXL column display
llandale - Mon Dec 15 18:17:14 EST 2014

PatRoof - Mon Dec 15 14:59:57 EST 2014

Thank you Louie

I tried what you suggested (see below) and it didn't work.  Any other suggestions.

 

pragma runLim,0
Buffer c = create()
c = obj."BL Object Heading"
Buffer d = create()
d = obj."Object Heading"
Buffer e = create()
e = obj."BL Object Text"
Buffer f = create()
f = obj."Object Text"
if ( length(c) == 0 )
{
     Object o
     string s
     s = probeRichAttr_(obj,"Object Heading", false)
     displayRich s
}else
{
    Buffer resBuf = create
    diff(resBuf, c, d, "\\cf1\\strike ", "\\cf3\\ul ")
    Buffer resBuf1 = create()
    resBuf1 += "\\b "
    combine (resBuf1, resBuf,0)
    displayRichWithColour (tempStringOf resBuf1)
    delete resBuf
    delete resBuf1
}
if ( length(e) == 0 )
{    Object o
     string s
     s = probeRichAttr_(obj,"Object Text", false)
     displayRich  s
} else
{
    Buffer resBuf = create
    diff(resBuf, e, f, "\\cf1\\strike ", "\\cf3\\ul ")
    displayRichWithColour (tempStringOf resBuf)
    delete resBuf
}
delete(c)
delete(d)
delete(e)
delete(f)

I've been playing with RTF for a while and am still in trial-and-error mode.

Print the contents of resBuf.  I think it will start with "{rtf1 " bla bla.  If so, my suggestion was silly.  I forgt it came from diff().

If so, then maybe you can remove the "{rtf1 " and replace it with "{rtf1 \b ", although that may get ignored when you run into a "\parm " code.

Or put some silly string "bbbe4333333daoiudhtb" at the beginning of both "c" and "d", then add the attr values, then replace that string in resBuf to "\b " afterwards.  Sounds hokey and useless and probably is; but that's what 'trial and error" means to me.

-Louie