![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Syntax for History attributes Topic Summary: Need answer from someone who knows Created On: 25-Oct-2007 18:59 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi folks.
I'm using the history capability in DXL for the first time. This statement (inside a for loop): History h if ((string h.attrName) == "Object Text) draws the following error in the feedback window: -R-W-DXL: <line 999> wrong history type createObject for attribute name or the following: R-W-DXL: <line 999> wrong history type createLink for attribute name What's really puzzling is it actually does go into the if statement (I have a print stmt inside to show I went there), and the program doesn't crash with a runtime error... I want my users to be able to use this script without seeing this error. Anyone have an idea what's wrong? Thanks! ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
Tara put a test in front of your test to ensure your dealing with an attribute history record.
Test is similar to following: HistoryType ht = h.type if(ht == createAttr || ht == modifyAttr || ht == deleteAttr) print h.attrName |
|
![]() |
|
![]() |
|
History properties, h.attrName in this case, are defined only for specific History Types. In this case, a 'createObject' history record does not have any defined value for 'attribute name'. So if the h.type is createObject, then don't try to access the h.attrName.
Realistically then, when dealing with history, you need to first get the "HistoryType ht = hst.type", and then do checks to make sure that the type is appropriate for your property. Attached find the functions I use to extract the attribute name, if any, from the History record. You need trial and error to figure out which properties apply to which types. IIRC, I used a test program that surrounded property extraction with noError() and lastError() calls, in order to figure out which properties applied. I had to create a module with all the various History types which turned out to be quite tricky. Also, BTW IIRC, you cannot put a 'History' variable into some other structure like a Skip list, figuring to extract it later. Assigning History e.g. h1 = h2 is NOT copying the value of h2 to h1, its assigning an alias of h2 to include h1. Not sure how to get around that. - Louie Edited: 29-Oct-2007 at 18:22 by Louie Landale |
|
![]() |
|
![]() |
|
Thank you guys for your responses; they've been of great help.
I have one more little problem. I'm outputting results to a Microsoft file. When retrieving h.oldValue and h.newValue, and then exporting via string I get all the formatting information with it as in: {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}\viewkind4\UC1\pard\f0\fs20
\par} {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}} Thanks again for all your great advice.
>
------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time Edited: 26-Oct-2007 at 15:58 by Tara Wilk |
|
![]() |
|
![]() |
|
My previous message got mangled because of my use of angle brackets.
What I meant to say was the output looks like: {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}\viewkind4\UC1\pard\f0\fs20 OBJECT TEXT \par} {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}} Thanks again for all your great advice.ffice
T. Wilk
------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
Okay, so I figured out this is in rich text format.
How do I strip just the text out of this string? Thanks, TW ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
In case anyone's interested I found a way to do this.
Just let me know and I'll post. (It might take me a while since I'm working on a black program and will have to key it in from scratch.) Thanks again, T. Wilk ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
quote: Use plainOldValue and plainNewValue.... ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
I think you need to work on not hitting the submit button twice Tara.
![]() ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
I haven't been...don't know what the problem is.
------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Syntax for History attributes
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.