It's all about the answers!

Ask a question

How to check other items in skip list without rechecking current item


Christopher Cote (15117) | asked Aug 07 '21, 9:09 a.m.
edited Aug 07 '21, 9:17 a.m.

 I am looping through a skiplist that contains other skiplists.  On each individual skip, I need to loop through the objects in that skiplist to get the absolute number of the objects.  I then want to go back and loop through the main skiplist and see if any of the other object skips contain that absolute number.  Because I don't know if there's a way to go through object 1 - length of a skip list, how do I make sure that the inner skiplist is not the one I'm currently looking at.  Here's a small sample of my pseudo-code:

for blSkip in skBLNewChangedObjects do {
    for obj in blSkip do {
        if (obj."Object Text""" != "") {               //We're not looking at a heading object
            absNum = obj."Absolute Number";
            //Now search remainder of skips in skBLNewChangedObjects to see if one of them also //has same absNum, skipping over current skip and any previous ones as well } } }
What is the easiest and/or best way to perform this check so I don't waste time searching the same skiplist?  Most of the time, the inner skiplist will contain less than 50 items, so that isn't the issue.  The issue is that I don't want to search through a skiplist that I'm currently checking.  I know that skiplists don't have a specific order like an array where I can check items n - skip length.

Chris Cote

One answer



permanent link
Christopher Cote (15117) | answered Aug 09 '21, 8:04 a.m.
edited Aug 09 '21, 9:08 a.m.

The first loop is looping through a skip list that contains skip lists.  I then, in my second loop, loop through each of these inner skip lists.  I know it's confusing, but I'm trying to use a skip list of individual skip lists that contains data for each object.

In basic terms, the module contains information about some custom scripts we've created and we want to list the scripts that have changed from one baseline and another and what those changes are.  Currently, the script requires users to select 2 consecutive baselines, but we'd like to make it so that a user can select any 2 baselines and see all the changes that were made to each script between each baseline.  Here's a sample of what the output would look like if the user chose baselines 1.3 and 1.6:

Script Name:  XYZ
Script Description: Whatever is in the Description attribute for this script
Type of Change:  Either New or Updated
Current Version: 3.3
Changes since previous baseline:
Baseline 1.4 - N/A
Baseline 1.5 - Bug 22 - Added functionality to the script
Baseline 1.6 - Bug 24 - Fixed added function in the script

So, in other words, I would want to loop through all of the scripts in the module and make note of what has changed or if it was a new script.  Then, when I create the report, loop through each script and then loop through the changes made in each baseline.

Chris

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.