Finding a Skip type element in a Skip

2012-01-14  Source: Original Site  Category:Rational  Views:0 

Advertisement

I am having some problems with a more complex skip structure.
What I do is, I create a Skip filled with skip type elements which in turn each have a number of skip type elements which then have int typ elements.

So the structure is

SKIP
SKIP
SKIP
INT
INT
INT
SKIP
INT
INT
INT
etc.

Each skip is put in the father skip by using a string key.

Now the problem comes when I try to retrieve a certain skip from that strucute. With the following code I can iterate over the whole structure with no problem, and it returns exactly what I need.

void outputMetricResult() { loggerDebug("(outputMetricResult) Starting."); Skip skpTempOutput1, skpTempOutput2, skpTempOutput3; string strCmp, strMetric, strArtifactType; int i; // iterate over all components for skpTempOutput1 in skpComponents do { strCmp = (string key(skpComponents)); loggerDebug("Component key: " strCmp ""); // iterate over all metrics for skpTempOutput2 in skpTempOutput1 do { strMetric = (string key(skpTempOutput1)); loggerDebug("Metric key: " strMetric ""); // iterate over all artifact types for i in skpTempOutput2 do { strArtifactType = (string key(skpTempOutput2)); loggerDebug("Artifact Type key: " strArtifactType ": " i ""); } } } loggerDebug("(outputMetricResult) Completed."); }

However when I try to find a specific skip with this code, I get an access violation. Does anyone know why?
Secondly: I have comment a part of the code out, because the third find function returns an "incorrect parameters for function find". I don't know why that happens either. I guess both are related to the fact that I try to find a skip type element in a skip.

string strCurrentComponent; // filled somewhere else beforehands string strCurrentArtifactType; // filled somewhere else beforehands Skip skpTempCmp; Skip SkpTempMtrc; Skip skpComponents = createString() // Structure is build somewhere else as defined above. bool addValueToCurrentIntForMetric(string strMetricName, int intIncrementor) { if(find(skpComponents, "" strCurrentComponent "", skpTempCmp)) { if(find(skpTempCmp, "" strMetricName "", skpTempMtrc)) { /* if(find(skpTempMtrc, strCurrentArtifactType, intFromSkip)) { intFromSkip = intFromSkip + intIncrementor; return true; } else { print("Couldn't find skip for artifact type: '" strCurrentArtifactType "'."); return true; } */ } else { print("Couldn't find skip for metric: '" strMetricName "'."); return true; } } else { print("Couldn't find skip for component: '" strCurrentComponent "'."); return true; } }

Grateful for any advice :-)

Best

Related articles
  • Finding a Skip type element in a Skip 2012-01-14

    I am having some problems with a more complex skip structure. What I do is, I create a Skip filled with skip type elements which in turn each have a number of skip type elements which then have int typ elements. So the structure is SKIP SKIP SKIP INT

  • Skip certain elements in an array? 2014-02-14

    Elements cannot be removed from an array. Is it possible to skip or hide particular items in an array by stating the element ID of the elements desired to be skipped? As far as I understand the method Skip() only skips the first element or elements,

  • skip marked elements while grepping through RoseModel 2015-03-12

    I`m creating a soda template that extracts documentation, diagrams etc from packages of a Rose-Modell into a word-document. I have the requirement, that some elements are only for internal use/explanation and should not be extracted to the word docum

  • How to find the Browser Type 2012-01-22

    In My ASP page I am using an <OBJECT> tag to embed an ActiveX control. It is working in IE 5.0 but not working in Netscape 4.6. Is there anyway to find out which type of browser the client is using so that I can do the Change dynamicall

  • how can you find out what type appliation a file is? 2012-02-15

    Hello. I'm able to get an Outlook attachment but I don't know what file type it is. What method can I use to find out what type of attachment it is? How can I find out if it is a word document or excel spreadsheet or ??? I can save this attachment to

  • CQ API Find the Record Type 2012-08-06

    I am trying to write a hook so that with the Record ID, I want to find the record type (Defect, Enhancement, etc), headline and status. Which method should I use?

  • xml Validate error (Cannot find the declaration of element) 2012-08-23

    I have some xml that's not validating. It returns the following error: Cannot find the declaration of element 'soap:Envelope' I've tried stripping out all the xml I can and it still returns the same error. Here is the basic xml I have: <?xml versi

  • need function that finds and replaces the elements , "... and also ç, é... 2013-04-08

    is their a function that finds and replaces the elements <, >, "... and also ç, é... example: ç becomes ç < becomes &lt; So, can I use an existing function for this or do I write one myself? Where do I find more information... (I use C+

  • Ubuntu Bash script for finding files by type 2013-07-24

    First, I am not experienced in scripting, so be gentle with me :D Anyway, I tried making a script for finding files by type ( audio, video, text...etc), and here's the poor result I came up with. #!/bin/bash FINDPATH="$1" FILETYPE="$2" locate $FINDPA

  • Ubuntu Nautilus find-as-you-type not working after upgrade to 9.04 2013-07-29

    I was running 8.04, did an upgrade to 9.04. I used the find as you type feature in Nautilus all the time, now when I start typing in the file manager nothing happens. Makes browsing my music folder and other directories with many subdirectories and f

  • Finding n-th largest element in two sorted lists 2013-10-15

    I have a little optimization problem, I have two lists of sorted elements and I need to pick n-th largest element from both lists combined. Now, since the data in both lists changes and I do not have control over the changes, I cannot combine the two

  • How to find the kth smallest element in an unsorted array of length n in O(n)? 2014-01-18

    given an unsorted array with n different numbers, how can I find the kth smallest elements (for each k=1,2,4,8,....) in O(n)? I thought of using selection alogrithm or a quick-sort based algorithm (i.e. finding median and using partition) but the pro

  • find the object type 2014-01-26

    How can I easily and safely find the objects type. There is some hierarchy and I want to find if my object is of type base or derived. e.g. Base * pBase = new Base; Deriver* pDerived = new Derived; if ( (Derived*) pDerived ) or if ( dynamic_cast<D

  • Ubuntu find-as-you-type missing in nautilus 2014-02-20

    all, I upgraded to 9.10 yesterday and found that the find-as-you-type functionality missing in nautilus. I wonder how to enable this.

  • How to find the kth largest element in an unsorted array of length n in O(n)? 2014-12-31

    given an unsorted array with n different numbers, how can I find the kth smallest elements (for each k=1,2,4,8,....) in O(n)? I thought of using selection alogrithm or a quick-sort based algorithm (i.e. finding median and using partition) but the pro

  • Ubuntu Firefox 2.0 find as you type 2015-01-14

    In Firefox 1.5, the find as you type feature used to have the next/previous buttons on the find-bar. Now I notice that Firefox 2.0 doesn't have them there, and that the next/previous buttons only show up if you do a CTL-F and then try to find somethi

  • How to find out which type of replication is running 2015-03-31

    Please anybody knows how to find out which type of replication is running in a system,whether it is regular replication or warm standby. Also how to check whether the data has been replicated to replicate side or not Thanks for your assistance. Rites

  • XmlReader skipping attr/element on Error? 2012-09-06

    I am running xhtml-strict report on a bunch of pages and each time I find a page on a specific page I save it. I need to really look over all the page but what happens is that sometimes the XmlReader is failling but I cannot go on and check the rest

  • jQuery NEWBIE Question: children() skips first element? 2012-05-18

    Hello, I am trying to simply grab the children of a div. The markup is: <div id="content"> <div id="panelPreview" class="fieldset_theme"> <div id="panelPreview_inner" class="hPanel"> <fieldset> <legend>[Section/Panel Hea

  • Loop - Skipping over elements? 2015-05-17

    Ok so I'm developing a blog from scratch and here is a part of my code, I've broken it up into three sections for you... This checks to see if the user wants to view an individual post if (isset($_GET['post'])){ while ($post = mysql_fetch_array($getP