Defined occurs when exists, init right index when looping in xml

This commit is contained in:
2015-07-29 15:18:56 +02:00
parent 8e65a50c3c
commit f0449c6874
2 changed files with 18 additions and 6 deletions

View File

@ -83,18 +83,27 @@ namespace CobXmlSupport
if(!latestList.Contains(wrkList[i])){
string countVar = "";
string tagName = "";
int occNum = 0;
if (!wrkList[i].Equals(""))
{
string chosenKey = indexes.FirstOrDefault(x => x.Value == wrkList[i]).Key; // indexes = <FieldName , FieldIndex> search FieldName from present FieldIndex
countVar = rows.First(x => x.FieldName == chosenKey).CountIn; // from cobrows find "Count In"-variable for given FieldName
tagName = rows.First(x => x.FieldName == chosenKey).TagName; // from cobrows find "xmltag" for given FieldName
occNum = rows.First(x => x.FieldName == chosenKey).occNum;
string inLst = "";
int j = i + 1;
//genCode += "\r\n *>" + wrkString;
if (inOut) // When moving to cobol xml structure
{
genCode += "\r\n MOVE "+ S.ettingMaxOcc + " TO " + countVar;
if (occNum.ToString() != S.ettingMaxOcc && occNum!=0)
{
genCode += "\r\n MOVE " + occNum.ToString() + " TO " + countVar;
}
else
{
genCode += "\r\n MOVE " + S.ettingMaxOcc + " TO " + countVar;
}
// genCode += "\r\n MOVE 0 TO " + countVar;
while (wrkList.Length > j)
{