diff --git a/CobXmlSupport/GenCobCode.cs b/CobXmlSupport/GenCobCode.cs index db6b6b6..d0f07b3 100644 --- a/CobXmlSupport/GenCobCode.cs +++ b/CobXmlSupport/GenCobCode.cs @@ -1716,9 +1716,20 @@ namespace CobXmlSupport } //obs under development + fromToMoves.CodeShower.Text += "IF "+ tmpQfh.qualCobRow.CountIn.ToString()+ " > 0 \r\n"; fromToMoves.CodeShower.Text += "MOVE " + tmpQfh.ToString(); fromToMoves.CodeShower.Text += "TO " + tmpQfh.ToExpString(); + fromToMoves.CodeShower.Text += "ELSE \r\n"; + fromToMoves.CodeShower.Text += "MOVE 0 TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n"; } + + indSt.handleStatus(null); + for (int i = 0; i < indSt.Returns; i++) + { + fromToMoves.CodeShower.Text += "END-PERFORM" + "\r\n"; + } + + fromToMoves.Show(); } diff --git a/CobXmlSupport/IndStatus.cs b/CobXmlSupport/IndStatus.cs index 3bb1f9f..b960e08 100644 --- a/CobXmlSupport/IndStatus.cs +++ b/CobXmlSupport/IndStatus.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Diagnostics; namespace CobXmlSupport { @@ -9,7 +10,7 @@ namespace CobXmlSupport { private List presentInds = null; private int returns = 0; - private string[] newInds=null; + private string[] newInds = null; public IndStatus() { @@ -22,18 +23,40 @@ namespace CobXmlSupport /// innehåller en string array med aktuella index för den kommande variabeln public void handleStatus(string[] new_Inds) { + Debug.WriteLine("------- present indexs -------"); + foreach (string prind in presentInds.ToArray()) + { + Debug.Write(prind + ", "); + } + Debug.WriteLine(""); + Debug.WriteLine("------- new indexs -------"); + + if (new_Inds != null) + { + foreach (string nind in new_Inds) + { + Debug.Write(nind + ", "); + } + Debug.WriteLine(""); + } + else + Debug.WriteLine(" = null "); + + returns = 0; List news = new List(); - if(new_Inds!=null) news.AddRange(new_Inds); + if (new_Inds != null) news.AddRange(new_Inds); foreach (string tmpStr in presentInds.ToArray()) { - if (news.Contains(tmpStr)) {} - else { + if (news.Contains(tmpStr)) { } + else + { presentInds.Remove(tmpStr); - returns += 1; + returns += 1; } } + List addedStrs = new List(); if (new_Inds != null) { @@ -51,9 +74,28 @@ namespace CobXmlSupport { newInds = addedStrs.ToArray(); } + else newInds = null; + + Debug.WriteLine("------- returns -------"); + Debug.Write(returns); + Debug.WriteLine(""); + + Debug.WriteLine("------- tillagda Inds -------"); + if (newInds != null) + { + foreach (string tlind in newInds) + { + Debug.Write(tlind + ", "); + } + Debug.WriteLine(""); + } + else + Debug.WriteLine(" = null "); + } + public int Returns { get diff --git a/CobXmlSupport/qualifieldhlp.cs b/CobXmlSupport/qualifieldhlp.cs index 065ff00..08b27c6 100644 --- a/CobXmlSupport/qualifieldhlp.cs +++ b/CobXmlSupport/qualifieldhlp.cs @@ -14,6 +14,14 @@ namespace CobXmlSupport private string qfhCode, qfhInd ; private string[] indexStrs; + public CobRow qualCobRow + { + get + { + return qualifiedRow; + } + } + public string indexText { get { return qfhInd; }