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: Looping over history strange behavior
Topic Summary:
Created On: 12-Feb-2004 12:31
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-2004 12:31
User is offline View Users Profile Print this message


Frank Lipski

Posts: 42
Joined: 6-Nov-2002

I am running a DXL script that is attempting to restore an object's Object Text back to the first value it has in its history record.



Basically in the attached code, I have the following:





History toRestore, h



For h in o do {

// at one point I do once and only once the assignment

toRestore = h



}



What appears to be happening is that toRestore always points to the last history record. It appears that the toRestore = h justs sets a pointer to h (it does not copy the entire history record as it exists at that point in time., but as h is being re-used within the for loop, so at the end, it always points to the last history record.



Is this indeed the case? Is there a way to force the copy to occur. Has anyone else seen anything like this before.

I have had discussions with DOORS support, and they have given me various answers, including why do I need to save the history, just do my modifications then. Answer, I need to continue to examine the history for other changes like deletions that may negate the need to restore. Another option they have give is to save the individual pieces, which could work but is cumbersome and doesn't satsify me with why the strange behavior.

If you take an object with no History, and make a number of modifications to the Object Text and run the attached code, you can see the behavior.

Report this to a Moderator Report this to a Moderator
 12-Feb-2004 12:55
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

You need to add a break immediately after "found = true".
ignore this - i didn't read the comments properly

-------------------------
Tony Goodman
http://www.smartdxl.com

Edited: 12-Feb-2004 at 13:00 by Tony Goodman
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.