![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Finding the most recently modified object Topic Summary: Created On: 16-Mar-2005 09:47 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
The attached code prints out "createAttr" (which is the type of the last history record in the module), and not "modifyObject" as you might expect
![]() |
|
![]() |
|
![]() |
|
History is a history record
HistoryType is a type of history You were mixing & matching. See proper use in example code History h HistoryType ht for h in current Module do { ht = h.type if (ht == modifyObject ) print ht "\n"} |
|
![]() |
|
![]() |
|
Ron,
My code is attempting to find the last History record which has the type 'modifyObject'. The 'for' loop only assigns history records of type 'modifyObject' to hmo, so on completion of the loop I am surprised to find it referring to a history record of type 'createAttr'. I don't see how I am 'mixing & matching' anything. |
|
![]() |
|
![]() |
|
the dxl help file does not show your use of if (h.type == modifyObject) as being correct
|
|
![]() |
|
![]() |
|
Paul
The problem is that hmo and h are references. When you assign hmo=h you are not making a copy of the value, you are making the address pointed to by hmo equal to the address pointed to by h. Therefore, as soon as the if statement evaluates to true once, the value returned by hmo is permanently the same as the value returned by h whether or not the if statement ever evaluates to true again. If you want to store the information in h when the if statement is true then you need to extract it from the history record at that point and store it in some other type of variable. Jon ------------------------- Jonathan Marshall EADS Astrium Edited: 18-Mar-2005 at 12:01 by Jonathan Marshall |
|
![]() |
|
![]() |
|
Are History variables unique in this behaviour? The following two loops work as I would have expected (i.e. they print "Object Text" and "45" respectively):
Edited: 18-Mar-2005 at 13:33 by Paul Worrall |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Finding the most recently modified object
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.