Completed code generation new method
This commit is contained in:
@ -1682,10 +1682,12 @@ namespace CobXmlSupport
|
||||
|
||||
private void btnTestThings_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool adj = true;
|
||||
fromToMoves = new ShowCode();
|
||||
fromToMoves.Parent = this;
|
||||
fromToMoves.Labeltext = "Testing to Creat \"move From \" Code";
|
||||
|
||||
|
||||
Dictionary<string, string> testIndexes = new Dictionary<string, string>();
|
||||
IndexState lIs = new IndexState(testIndexes,rowList);
|
||||
//if (qldList == null)
|
||||
@ -1711,16 +1713,31 @@ namespace CobXmlSupport
|
||||
{
|
||||
foreach (string indTxt in indSt.NewInds)
|
||||
{
|
||||
fromToMoves.CodeShower.Text += "PERFORM VARYING " + indTxt + " FROM 1 BY 1 UNTIL ??? " + "\r\n";
|
||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" + tmpQfh.indexRedText;
|
||||
fromToMoves.CodeShower.Text += " TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n " + tmpQfh.indexRedText;
|
||||
fromToMoves.CodeShower.Text += " PERFORM VARYING " + indTxt + " FROM 1 BY 1\r\n UNTIL " +
|
||||
indTxt + " > " + tmpQfh.qualCobRow.CountIn.ToString() + "\r\n" + tmpQfh.indexRedText;
|
||||
}
|
||||
}
|
||||
//obs under development
|
||||
if (tmpQfh.qualCobRow.FieldDef != "")
|
||||
{
|
||||
if (tmpQfh.qualCobRow.FieldName.ToUpper().Contains("_VALUE")) { }
|
||||
else fromToMoves.CodeShower.Text += " IF " + tmpQfh.qualCobRow.CountIn.ToString() + "\r\n" + tmpQfh.indexText + " > 0 \r\n";
|
||||
|
||||
fromToMoves.CodeShower.Text += "IF "+ tmpQfh.qualCobRow.CountIn.ToString()+ " > 0 \r\n";
|
||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.ToString();
|
||||
fromToMoves.CodeShower.Text += " TO " + tmpQfh.ToExpString();
|
||||
|
||||
if (tmpQfh.qualCobRow.FieldName.ToUpper().Contains("_VALUE")) { }
|
||||
else
|
||||
{
|
||||
fromToMoves.CodeShower.Text += " MOVE " + tmpQfh.qualCobRow.CountIn + "\r\n" + tmpQfh.indexText;
|
||||
fromToMoves.CodeShower.Text += " TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + tmpQfh.indexText;
|
||||
fromToMoves.CodeShower.Text += " ELSE\r\n";
|
||||
fromToMoves.CodeShower.Text += "MOVE 0 TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n";
|
||||
fromToMoves.CodeShower.Text += " MOVE 0 TO " + tmpQfh.qualCobRow.CountIn.ToString().Replace(S.ettingPrefix, S.ettingExpPrefix) + "\r\n" + tmpQfh.indexText;
|
||||
fromToMoves.CodeShower.Text += " END-IF\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
indSt.handleStatus(null);
|
||||
|
||||
@ -23,24 +23,24 @@ namespace CobXmlSupport
|
||||
/// <param name="new_Inds">innehåller en string array med aktuella index för den kommande variabeln</param>
|
||||
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 -------");
|
||||
//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 ");
|
||||
//if (new_Inds != null)
|
||||
//{
|
||||
// foreach (string nind in new_Inds)
|
||||
// {
|
||||
// Debug.Write(nind + ", ");
|
||||
// }
|
||||
// Debug.WriteLine("");
|
||||
//}
|
||||
//else
|
||||
// Debug.WriteLine(" = null ");
|
||||
|
||||
|
||||
returns = 0;
|
||||
@ -76,21 +76,21 @@ namespace CobXmlSupport
|
||||
}
|
||||
else newInds = null;
|
||||
|
||||
Debug.WriteLine("------- returns -------");
|
||||
Debug.Write(returns);
|
||||
Debug.WriteLine("");
|
||||
//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 ");
|
||||
//Debug.WriteLine("------- tillagda Inds -------");
|
||||
//if (newInds != null)
|
||||
//{
|
||||
// foreach (string tlind in newInds)
|
||||
// {
|
||||
// Debug.Write(tlind + ", ");
|
||||
// }
|
||||
// Debug.WriteLine("");
|
||||
//}
|
||||
//else
|
||||
// Debug.WriteLine(" = null ");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ namespace CobXmlSupport
|
||||
private CobRow qualifiedRow;
|
||||
private List<CobRow> qualRows;
|
||||
private Dictionary<string, string> locIndexis;
|
||||
private string qfhCode, qfhInd ;
|
||||
private string qfhCode, qfhInd, qfhRedInd ;
|
||||
private string[] indexStrs;
|
||||
|
||||
public CobRow qualCobRow
|
||||
@ -27,6 +27,11 @@ namespace CobXmlSupport
|
||||
get { return qfhInd; }
|
||||
}
|
||||
|
||||
public string indexRedText
|
||||
{
|
||||
get { return qfhRedInd; }
|
||||
}
|
||||
|
||||
public string[] indexStrings
|
||||
{
|
||||
get { return indexStrs; }
|
||||
@ -91,15 +96,14 @@ namespace CobXmlSupport
|
||||
private void initLocIndexTxt()
|
||||
{
|
||||
qfhInd = "";
|
||||
qfhRedInd = "";
|
||||
indexStrs = null;
|
||||
if (locIndexis!=null && locIndexis.Count > 0)
|
||||
{
|
||||
indexStrs=new string[locIndexis.Count];
|
||||
int indCnt = 0;
|
||||
foreach (KeyValuePair<string, string> tmpInd in locIndexis)
|
||||
indexStrs = locIndexis.Values.ToArray();
|
||||
foreach (KeyValuePair<string, string> tmpInd in locIndexis.Reverse())
|
||||
{
|
||||
indexStrs[indCnt++] = tmpInd.Value;
|
||||
|
||||
if (qfhInd.Length == 0)
|
||||
{
|
||||
qfhInd = " ( " + tmpInd.Value;
|
||||
@ -110,7 +114,26 @@ namespace CobXmlSupport
|
||||
}
|
||||
}
|
||||
qfhInd += " )\r\n";
|
||||
if (locIndexis.Count > 1)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> tmpInd in locIndexis.Reverse())
|
||||
{
|
||||
indCnt++;
|
||||
if (indCnt == locIndexis.Count) break;
|
||||
if (qfhRedInd.Length == 0)
|
||||
{
|
||||
qfhRedInd = " ( " + tmpInd.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
qfhRedInd += ",\r\n " + tmpInd.Value;
|
||||
}
|
||||
}
|
||||
qfhRedInd += " )\r\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -143,6 +166,7 @@ namespace CobXmlSupport
|
||||
else break;
|
||||
}
|
||||
initLocIndexTxt();
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
Reference in New Issue
Block a user