handling of performs and indices the new way

This commit is contained in:
2014-12-05 00:12:34 +01:00
parent 29d2057c01
commit 28239d2b53
2 changed files with 53 additions and 17 deletions

View File

@ -1697,12 +1697,25 @@ namespace CobXmlSupport
qualifieldhlp tmpQlh = new qualifieldhlp(zRow, lIs.Indexes); qualifieldhlp tmpQlh = new qualifieldhlp(zRow, lIs.Indexes);
qldList.Add(tmpQlh); qldList.Add(tmpQlh);
} }
IndStatus indSt = new IndStatus();
foreach (qualifieldhlp tmpQfh in qldList) 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 += "MOVE " + tmpQfh.ToString();
fromToMoves.CodeShower.Text += "TO " + tmpQfh.ToExpString(); fromToMoves.CodeShower.Text += "TO " + tmpQfh.ToExpString();
} }

View File

@ -16,36 +16,59 @@ namespace CobXmlSupport
presentInds = new List<string>(); presentInds = new List<string>();
} }
/// <summary>
/// Bearbetar status av förekommande indexvariabler i aktuell xml-struktur
/// </summary>
/// <param name="new_Inds">innehåller en string array med aktuella index för den kommande variabeln</param>
public void handleStatus(string[] new_Inds) public void handleStatus(string[] new_Inds)
{ {
returns = 0;
List<string> news = new List<string>(); List<string> news = new List<string>();
news.AddRange(new_Inds); if(new_Inds!=null) news.AddRange(new_Inds);
foreach (string tmpStr in presentInds)
{
if (news.Contains(tmpStr)) { }
else {
returns += 1;
foreach (string tmpStr in presentInds.ToArray())
{
if (news.Contains(tmpStr)) {}
else {
presentInds.Remove(tmpStr);
returns += 1;
} }
} }
List<string> addedStrs = new List<string>(); List<string> addedStrs = new List<string>();
if (new_Inds != null)
{
foreach (string tmpInStr in new_Inds) foreach (string tmpInStr in new_Inds)
{ {
if (presentInds.Contains(tmpInStr)){} if (presentInds.Contains(tmpInStr)) { }
else else
{ {
presentInds.Add(tmpInStr); presentInds.Add(tmpInStr);
addedStrs.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;
}
}
} }
} }