![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Copy contents of attribute from object 1 to same attribute in object 2 Topic Summary: Created On: 1-Feb-2008 19:48 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
OK...This sounds simple enough on the top and probably is, I'm just over looking something.
I'm specifically referring to the "Object Text" attribute. I have objects may contain OLE's or pictures along with text. The copy objects function will create a new object in a new module fine and dandy and have played around in that script (doorsHome\lib\dxl\standard\fns\copyObjects.inc), but I'm can't seem to figure out how the objects are copied with the OLE/Picture and the text. I've tried the oleCopy and olePaste functions, but the ole isn't placed in the correct spot in reference to the text. Any ideas? Thanks, ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Damnit....
I keep posting a question on here and then find the answer 5 minutes later. set (newObject."Object Text", oldObject."Object Text") ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Scott also check out my tool here.
Copy Values ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Thanks David.
Wish links were like attributes....lol. One thing I did notice about the set function mentioned above, is that it seems like you do not have to check if the attribute has been modified. For example, I have object1 and object2, the "Object Text" attribute is the same in both. I issue the set (object1."Object Text", object2."Object Text") command. object1 is not modified, so it would seem that function checks if the attributes are the same before copying the info over. I checked the history when doing this and there is no history record either which supports this even more. This is actually nice because now I don't have to write the code to check for differences first. ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
I can't seem to find that function in the DXL Reference manual. Is it undocumented?
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
That would be my guess, I found it in....
doorsHome\lib\dxl\standard\fns\copyAttributes.dxl (line 63). ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Interesting...I might use this in my tool. Thanks Scott.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Never seen this 'set', but I now see it in the doors.exe file. Doesn't seem to be in the DXL manual.
An object is not changed nor is History generated when you assign an attribute value in such a way that it doesn't change. o."A" = "B" generates no History when the value is already "B". This is not a feature unique to the 'set' command. In doors.exe, I see that this 'set' command returns a string. Normally that would be some sort of Error string. I see in the example that 'set' errors are trapped with noError() and lastError(). Testing shows that trapping works, but that the string returned from set is null when its OK and garbage when attr2 doesn't exist. I see that if you don't trap the errors, DXL aborts. Makes me wonder what the returned string could be. We really should somehow test this 'set' command to see if it generates wasted string-table space. Surely the normal: o1."Object Text" = richText(richTextWithOle(o2."Object Text")) wastes space, even when o1 already has that exact value. If set eliminates that, then it will prove to be a great function to use. EDIT: I now notice with considerable alarm the checks in that code to report when an attr-value has been 'truncated' by 'set'; look for 'matrTruncated' in copyAttributes.dxl. Egads, if it truncates then its practically useless. - Louie Edited: 4-Feb-2008 at 17:12 by Louie Landale |
|
![]() |
|
![]() |
|
I wonder if the truncation is a check if the attribute is of a string type. I've seen truncation happen in this situation before when copying text from a text type attribute to a string type attribute.
For some reason the string type seems to be limited to how much data it can hold, while the text can hold much more (I've never hit the limit). Hence for this reason I've stayed away from string type attributes, just in case I need to dump more information into the attribute. This is where your truncation might come into play. I'll have to look a little bit closer at the code that checks for truncation.... ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Aye, just tested that theory with the copying more data than a string type attribute can accept.
Here's what I did..... - Created a "Test" attribute of type "string" - Dumped a bunch of text into the "Object Text" of the same object. - Ran the attached script. Script printed the following error: -R-W- DXL: <Line:4> value assigned to string attribute 'Test' truncated If you comment out the print statement, you don't get the error. ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.