ADDTABLE"TB_DATATYPES"
AREA "Schema Area"
DUMP-NAME "tb_datat"ADDFIELD"c1"OF"TB_DATATYPES"ASCHARACTER
FORMAT "X(8)"
INITIAL ""POSITION2
SQL-WIDTH 16ORDER10ADDFIELD"c4"OF"TB_DATATYPES"ASINTEGER
FORMAT "->,>>>,>>9"
INITIAL "0"POSITION5
SQL-WIDTH 4ORDER20ADDFIELD"c5"OF"TB_DATATYPES"AS logical
FORMAT "yes/no"
INITIAL "no"POSITION6
SQL-WIDTH 1ORDER30.
PSC
cpstream=ISO8859-1.
0000000976
TO:
CREATETABLE TB_DATATYPES
(
c1 CHAR(16)NULL,
c4 INTNULL,
c5 BIT NULL)
转换Progress 4GL 触发器到 Microsoft SQL Server触发器/功能或C#类:
TRIGGERPROCEDUREFORDELETEOF gsinvhd.
FIND distribution
WHERE distribution.company = gsinvhd.company NO-LOCK
NO-ERROR.TO:
CREATETRIGGER SWT_Delete_gsinvhd
ON gsinvhd
AFTER DELETEASDECLARE @distribution_company VARCHAR(255)SELECT @distribution_company = company FROM distribution
WHERE distribution.company = gsinvhd.company
Progress 4GL代码转换为.NET代码:
转换Progress 4GL功能文件(*.p)到C#类
转换Progress 4GL包含文件(*.i)到C#类/代码
FUNCTION days-in-month RETURNS INTEGER
( INPUT pmonth AS INTEGER, INPUT pyear AS INTEGER ):
DEFINE VARIABLE idays AS INTEGER EXTENT 12 INITIAL
[31,28,31,30,31,30,31,31,30,31,30,31].
IF pmonth NE 2 THEN DO:RETURN idays[pmonth].
END.
ELSEDO:IF INTEGER(pyear /4)*4= pyear THEN DO:IF INTEGER(pyear /100)*100= pyear THEN DO:IF INTEGER(pyear /400)*400= pyear
THEN RETURN29.
ELSERETURN28.
END.
ELSERETURN29.
END.
ELSERETURN28.
END.
END FUNCTION.
usingSystem;
usingSystem.Collections.Generic;
namespace Ispirer.Services.Source{publicclass TestClass
{static TestClass(){}publicint Days_in_month(int pmonth, int pyear){int[] idays =newint[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if(pmonth !=2){return idays[pmonth -1];
}else{if(Convert.ToInt32(pyear /4)*4== pyear){if(Convert.ToInt32(pyear /100)*100== pyear){if(Convert.ToInt32(pyear /400)*400== pyear)return29;
elsereturn28;
}elsereturn29;
}elsereturn28;
}}}}
转换Progress 4GL Window功能(*.w)文件到:
Windows Forms
Windows Presentation Foundation (WPF)
jia假如, 到 WinForms:
Ispirer MnMTK自动地分开Progress 4GL window的逻辑 (*.w):
UI logic to “.Designer.cs”
ON triggers logic to source code “.cs”
转换数据存取到:
ADO.NET
LINQ
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE generate-data Procedure
PROCEDURE generate-data :
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE gc-company AS CHARACTER NO-UNDO.
FIND company WHERE company.company= gc-company NO-LOCK NO-ERROR.
find budget where budget.company= gc-company no-lock no-error.
Dowhile avail budget:Do i =0 to company.num-periods:
find budget-analysis where
budget-analysis.user-id = company.gc-user-id and
budget-analysis.company= gc-company and
budget-analysis.pc-center ="ALL" and
budget-analysis.acct-period = i
no-error.
End.
End.
END PROCEDURE.
&ANALYZE-RESUME
TO:usingSystem;
usingSystem.Collections.Generic;
usingSystem.Data;
usingSystem.Linq;
namespace Ispirer.Services.Source{publicclass Gn_Data
{#region Implicit buffers
Data.Tables.company company;
Data.Tables.budget budget;
Data.Tables.budget_analysis budget_analysis;
#endregionpublic Gn_Data(){}publicvoid Generate_data(){int i =0;
string gc_company =string.Empty;
company =(from company_Row in Db.company
where company_Row.company== gc_company
select company_Row).FirstOrDefault();
budget =(from budget_Row in Db.budget
where budget_Row.company== gc_company
select budget_Row).FirstOrDefault();
while(budget !=null){for(i =0; i <= company.num_periods; i++){
budget_analysis =(from budget_analysis_Row in Db.budget_analysis
where budget_analysis_Row.user_id== company.gc_user_id&&
budget_analysis_Row.company== gc_company &&
budget_analysis_Row.pc_center=="ALL"&&
budget_analysis_Row.acct_period== i
select budget_analysis_Row).FirstOrDefault();
}}}}}
转换Progress 4GL Web Service Mapping Files(*.wsm)到XML Web service (*.asmx.cs)