diff --git a/CobXmlSupport/GenCobCode.cs b/CobXmlSupport/GenCobCode.cs index 51a98bd..db6b6b6 100644 --- a/CobXmlSupport/GenCobCode.cs +++ b/CobXmlSupport/GenCobCode.cs @@ -1697,12 +1697,25 @@ namespace CobXmlSupport qualifieldhlp tmpQlh = new qualifieldhlp(zRow, lIs.Indexes); qldList.Add(tmpQlh); } + IndStatus indSt = new IndStatus(); foreach (qualifieldhlp tmpQfh in qldList) { - if (tmpQfh.indexStrings != null) - { + //obs under development + indSt.handleStatus(tmpQfh.indexStrings); + for (int i = 0; i < indSt.Returns; i++) + { + fromToMoves.CodeShower.Text += "END-PERFORM" + "\r\n"; } + if (indSt.NewInds != null) + { + foreach (string indTxt in indSt.NewInds) + { + fromToMoves.CodeShower.Text += "PERFORM VARYING " + indTxt + " FROM 1 BY 1 UNTIL ??? " + "\r\n"; + } + } + //obs under development + fromToMoves.CodeShower.Text += "MOVE " + tmpQfh.ToString(); fromToMoves.CodeShower.Text += "TO " + tmpQfh.ToExpString(); } diff --git a/CobXmlSupport/IndStatus.cs b/CobXmlSupport/IndStatus.cs index 2fa5c4b..3bb1f9f 100644 --- a/CobXmlSupport/IndStatus.cs +++ b/CobXmlSupport/IndStatus.cs @@ -16,36 +16,59 @@ namespace CobXmlSupport presentInds = new List(); } + /// + /// Bearbetar status av förekommande indexvariabler i aktuell xml-struktur + /// + /// innehåller en string array med aktuella index för den kommande variabeln public void handleStatus(string[] new_Inds) { - + returns = 0; List news = new List(); - news.AddRange(new_Inds); - foreach (string tmpStr in presentInds) - { - if (news.Contains(tmpStr)) { } - else { - returns += 1; + if(new_Inds!=null) news.AddRange(new_Inds); + foreach (string tmpStr in presentInds.ToArray()) + { + if (news.Contains(tmpStr)) {} + else { + presentInds.Remove(tmpStr); + returns += 1; } } List addedStrs = new List(); - foreach (string tmpInStr in new_Inds) + if (new_Inds != null) { - if (presentInds.Contains(tmpInStr)){} - else + foreach (string tmpInStr in new_Inds) { - presentInds.Add(tmpInStr); - addedStrs.Add(tmpInStr); + if (presentInds.Contains(tmpInStr)) { } + else + { + presentInds.Add(tmpInStr); + addedStrs.Add(tmpInStr); + } } } - - // Utveckling pågår ! + if (addedStrs.Count > 0) + { + newInds = addedStrs.ToArray(); + } } + public int Returns + { + get + { + return returns; + } + } - + public string[] NewInds + { + get + { + return newInds; + } + } } }