called procedures when looping

This commit is contained in:
2015-09-28 11:51:57 +02:00
parent c5e6406a04
commit a372fc306a

View File

@ -260,7 +260,7 @@ namespace CobXmlSupport
}
if (rw.Move_FromCode == null) { rw.MoveFromCode = " "; }
Cc.WorkDicOut[rw.FieldName] = rw.Move_FromCode;
FieldList.Add(rw.FieldName,objNr++);
FieldList.Add(rw.FieldName, objNr++);
}
// Prefill with possibly filled out code
if (chkWrap.Checked)
@ -279,7 +279,7 @@ namespace CobXmlSupport
foreach (string jkey in jkeys)
{
int item;
if (!FieldList.TryGetValue(jkey,out item))
if (!FieldList.TryGetValue(jkey, out item))
{
string checktxt = "";
Cc.WorkDicIn.TryGetValue(jkey, out checktxt);
@ -2197,6 +2197,7 @@ namespace CobXmlSupport
private void createXMLMoveCode(savedFile SF, bool justOut = false)
{
bool loopTyp = false;
string SectionNames="",BoolVars="";
qualifieldhlp locTmpQfh = null;
//Create showing window
fromToMoves = new ShowCode();
@ -2258,11 +2259,11 @@ namespace CobXmlSupport
{
foreach (string indTxt in indSt.NewInds)
{
// if (!justOut)
// {
//Before perform varying, move the count-value from old structure to new
string chosenKey = testIndexes.FirstOrDefault(x => x.Value == indTxt).Key; // indexes = <FieldName , FieldIndex> search FieldName from present FieldIndex
locTmpQfh = qldList.First(x => x.qualCobRow.FieldName == chosenKey); // Find QualifiedHelp-object for right field
// if (!justOut)
// {
//Before perform varying, move the count-value from old structure to new
string chosenKey = testIndexes.FirstOrDefault(x => x.Value == indTxt).Key; // indexes = <FieldName , FieldIndex> search FieldName from present FieldIndex
locTmpQfh = qldList.First(x => x.qualCobRow.FieldName == chosenKey); // Find QualifiedHelp-object for right field
if (!justOut)
{
fromToMoves.CodeShower.Text += " MOVE " + locTmpQfh.qualCobRow.CountIn + "\r\n" + locTmpQfh.indexRedText;
@ -2272,6 +2273,10 @@ namespace CobXmlSupport
//Perform
fromToMoves.CodeShower.Text += " PERFORM VARYING " + indTxt + " FROM 1 BY 1\r\n UNTIL " +
indTxt + "\r\n > " + locTmpQfh.qualCobRow.CountIn.ToString() + "\r\n" + locTmpQfh.indexRedText;
string tmpCheckVar = "";
fromToMoves.CodeShower.Text += " PERFORM " + createAftReferenceSections(locTmpQfh.qualCobRow.TagName, "NXTO-",
indTxt, ref SectionNames) + "\r\n";
}
}
@ -2307,7 +2312,7 @@ namespace CobXmlSupport
//}
//else
//{
fromToMoves.CodeShower.Text += tmpQfh.qualCobRow.MoveFromCode + "\r\n";
fromToMoves.CodeShower.Text += tmpQfh.qualCobRow.MoveFromCode + "\r\n";
//}
}
else
@ -2352,6 +2357,8 @@ namespace CobXmlSupport
fromToMoves.CodeShower.Text += " END-PERFORM" + "\r\n";
}
fromToMoves.CodeShower.Text = SectionNames + "\r\n" + fromToMoves.CodeShower.Text;
fromToMoves.CodeShower.Text = BoolVars + "\r\n" + fromToMoves.CodeShower.Text;
//List all used indexes
string tempIndText = "";
fromToMoves.CodeShower.Text = addOccursVars(testIndexes, fromToMoves.CodeShower.Text, tempIndText);
@ -2360,6 +2367,24 @@ namespace CobXmlSupport
}
private string createAftReferenceSections(string tagName, string procPrefix, string indexVar, ref string wrkSectStr)
{
string tmpProcName = procPrefix + tagName.Replace("\"", "").Replace(":", "");;
if (!wrkSectStr.Contains(tmpProcName))
{
wrkSectStr += "\r\n *>------------------- HANDLE SECTION --------------*" + tmpProcName;
wrkSectStr += "\r\n * Den här sektionen används för att positionera ";
wrkSectStr += "\r\n * datat när den genererade xml-proceduren körs";
wrkSectStr += "\r\n *-------------------- HANDLE SECTION --------------*\r\n";
wrkSectStr += "\r\n " + tmpProcName + " SECTION.";
wrkSectStr += "\r\n * Styrs av :" + indexVar;
wrkSectStr += "\r\n .";
wrkSectStr += "\r\n " + tmpProcName + "-EX.";
wrkSectStr += "\r\n EXIT.\r\n";
}
return tmpProcName;
}
private void btnFrXMLTo_Click(object sender, EventArgs e)