Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: OLE and regexp
Topic Summary:
Created On: 12-Feb-2007 16:17
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 12-Feb-2007 16:17
User is offline View Users Profile Print this message


Dominic Butler

Posts: 3
Joined: 12-Feb-2007

Hello!  This is my first post to a DOORS forum.

Within a DXL script I am trying to change some text in an object that has OLEs in it.  If I use regular expressions the text can be changed but I lose the OLEs.  How can I get round this?

Thanks,

Dominic
Report this to a Moderator Report this to a Moderator
 12-Feb-2007 16:30
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Trying doing it this way.

I've done something similiar but I got the data into a richText box, edited it there, and then put it back.



-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 14-Feb-2007 11:13
User is offline View Users Profile Print this message


Dominic Butler

Posts: 3
Joined: 12-Feb-2007

Thanks David.  That's just what I need.

Dominic
Report this to a Moderator Report this to a Moderator
 15-Feb-2007 04:21
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

David's answer is technically correct: retrieve the Rich Text with 'richTextWithOle' and set it back using RichText. (I would use richTextWithOle(obj.NameAttr) however...).

Doing meaningful edits with DXL on a rich text string is very difficult, much more so if it contains an OLE diagram. You could plow through all the RichTextParagraph s of a Text field, and then through all the RichText chunks, keeping track of all the Italics and bolding yaddy yaddy. I imagine someone has actually done that.

With experimenting I discovered some things about some of the rich text commands:
[1] cutRichText uses start and end relative to the RAW text, and not relative to the Rich Text. You could therefore get both the richTextWithOle(obj.NameAttr) and also the raw obj.NameAttr, find the position of the text you care about in the Raw text, then use cutRichText on the rich text to get rid of it.

[2] replaceRichText uses offset and length relative to the rich text as determined via findRichText. The 'sub' string of findRichText and the string 'r' of replaceRichText are both raw text. so you could findRichText(TextWithOle, "This") and use that info to replaceRichText(TextWithOle, info from find, "That") to replace This with That.

[3] Nothing is easy, be SURE to text all DXL out on a sandbox database.


- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.