Changed to .csv files for saving

This commit is contained in:
2015-01-19 15:24:38 +01:00
parent 5ee839ec72
commit ddca2f7929
3 changed files with 80 additions and 26 deletions

View File

@ -1191,10 +1191,10 @@ namespace CobXmlSupport
genExtMoves.CodeShower.Text += "\r\n MOVE ";
if (cr.MoveCode.Trim().Length != 0)
genExtMoves.CodeShower.Text += "1";
else
if (cr.MoveCode == null || cr.MoveCode.Trim().Length < 1)
genExtMoves.CodeShower.Text += "0";
else
genExtMoves.CodeShower.Text += "1";
genExtMoves.CodeShower.Text += " TO " + cr.CountIn;
@ -1215,31 +1215,60 @@ namespace CobXmlSupport
CobRow crTmp = cr;
struktMove += "\r\n " + "".PadLeft(prfNiv) + " <" + cr.TagName.Replace("\"", "") + "> (" + cr.FieldName + ")";
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj);
genExtMoves.CodeShower.Text += "\r\n"; //" " + adjustIf(adj);
//------------- move from --------------
if (cr.MoveCode.Length > 1 && cr.MoveCode != " ")
//---------------- Changed
//if (cr.MoveCode.Length > 1 && cr.MoveCode != " ")
if (cr.MoveCode==null || cr.MoveCode.Trim() == "")
{
if (cr.FieldDef.ToUpper().IndexOf("X") > -1)
{
genExtMoves.CodeShower.Text += " " + adjustIf(adj) + "MOVE MoveToStringVar ";
}
else
{
genExtMoves.CodeShower.Text += " " + adjustIf(adj) + "MOVE MoveToNumVar ";
}
genExtMoves.CodeShower.Text += " *> #" + cr.FieldName + "#";
}
else
{
if (cr.MoveCode.ToUpper().Contains("MOVE") || (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO"))) { }
else genExtMoves.CodeShower.Text += "MOVE ";
genExtMoves.CodeShower.Text += cr.MoveCode;
}
else
{
if (cr.FieldDef.ToUpper().IndexOf("X") > -1)
{
genExtMoves.CodeShower.Text += "MOVE MoveToStringVar ";
}
else
{
genExtMoves.CodeShower.Text += "MOVE MoveToNumVar ";
}
}
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + " *> #" + cr.FieldName + "#";
//---------------- Changed
//if (cr.MoveCode.Length > 1 && cr.MoveCode != " ")
//{
// if (cr.MoveCode.ToUpper().Contains("MOVE") || (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO"))) { }
// else genExtMoves.CodeShower.Text += "MOVE ";
// genExtMoves.CodeShower.Text += cr.MoveCode;
//}
//else
//{
// if (cr.FieldDef.ToUpper().IndexOf("X") > -1)
// {
// genExtMoves.CodeShower.Text += " " + adjustIf(adj)+"MOVE MoveToStringVar ";
// }
// else
// {
// genExtMoves.CodeShower.Text += " " + adjustIf(adj)+ "MOVE MoveToNumVar ";
// }
// genExtMoves.CodeShower.Text += " *> #" + cr.FieldName + "#";
//}
//------------- move to ---------------
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj);
if (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO")) {}
else genExtMoves.CodeShower.Text += "TO ";
if (cr.MoveCode == null)
genExtMoves.CodeShower.Text += "TO ";
else
{
if (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO")) { }
else genExtMoves.CodeShower.Text += "TO ";
}
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + cr.FieldName;
genExtMoves.CodeShower.Text = checkForOccurs(indexNames, cr, genExtMoves.CodeShower.Text, ref occParRows, ref slask, false, adj);
while (crTmp.LevelParent != null)
@ -1252,8 +1281,14 @@ namespace CobXmlSupport
{
genExtMoves.CodeShower.Text += " (" + occParRows + " )";
}
if (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO")) {
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + "END-STRING " ;
if (cr.MoveCode == null) { }
else
{
if (cr.MoveCode.ToUpper().Contains("STRING") && cr.MoveCode.ToUpper().Contains("INTO"))
{
genExtMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + "END-STRING ";
}
}
if (chkMvToDisp.Checked)
@ -1896,6 +1931,7 @@ namespace CobXmlSupport
//Create showing window
fromToMoves = new ShowCode();
fromToMoves.Parent = this;
fromToMoves.BSynch = true;
fromToMoves.Labeltext = "Cobol \"CrossRef\" List";
foreach (CobRow cr in rowList)

View File

@ -83,6 +83,7 @@
this.btnSynch.TabIndex = 3;
this.btnSynch.Text = "Synch Moves";
this.btnSynch.UseVisualStyleBackColor = true;
this.btnSynch.Visible = false;
this.btnSynch.Click += new System.EventHandler(this.btnSynch_Click);
//
// ShowCode

View File

@ -15,11 +15,30 @@ namespace CobXmlSupport
{
public partial class ShowCode : Form
{
public readonly string CSV = ".csv";
string oldTxt;
bool bSynch;
public ShowCode()
{
InitializeComponent();
oldTxt = "";
bSynch = false;
}
public bool BSynch
{
get
{
return bSynch;
}
set
{
bSynch = value;
btnSynch.Visible = bSynch;
}
}
public TextBox CodeShower
@ -74,7 +93,7 @@ namespace CobXmlSupport
string inFile = parentWindow.CmbLastFile.Text.Substring(parentWindow.CmbLastFile.Text.LastIndexOf("\\") + 1);
string inPath = parentWindow.CmbLastFile.Text.Substring(0, parentWindow.CmbLastFile.Text.LastIndexOf("\\") + 1);
string codeFile = inFile.Substring(0, inFile.LastIndexOf(".")) + ".cvs";
string codeFile = inFile.Substring(0, inFile.LastIndexOf(".")) + CSV;
this.CodeShower.Text = " InPath = " + inPath + "\r\n InFile = " + inFile + "\r\n codeFile = " + codeFile + "\r\n codePath = " +inPath+ codeFile + "\r\n -------------- \r\n" + this.CodeShower.Text;
if (File.Exists(inPath + codeFile))
@ -116,10 +135,10 @@ namespace CobXmlSupport
DateTime.Now.Day.ToString("00") + "T" +
DateTime.Now.Hour.ToString("00") +
DateTime.Now.Minute.ToString("00") +
DateTime.Now.Second.ToString("00") + ".cvs";
DateTime.Now.Second.ToString("00") + CSV;
}
else {
backupfile = inPath + inFile.Substring(0, inFile.LastIndexOf(".")) + ".backup.cvs";
backupfile = inPath + inFile.Substring(0, inFile.LastIndexOf(".")) + ".backup"+CSV;
File.Delete(backupfile);
}
@ -220,7 +239,5 @@ namespace CobXmlSupport
}
}
}