Progress ABL to c# convert

EnguiD

New Member
i am looking for some help to convert this abl to c#. Any help would be greatly welcomed.

Code:
DEF VAR ct AS INTE NO-UNDO.

Output to C:\hardstampdownload\L2.csv .

For each ttLaborDtl where ttLaborDtl.RowMod = 'A' or ttLaborDtl.RowMod = 'U' no-lock:

Find first JobHead where JobHead.Company = ttLaborDtl.Company and JobHead.JobNum = ttLaborDtl.JobNum no-lock no-error .

Find first Part where Part.Company = JobHead.Company and Part.PartNum = JobHead.PartNum no-lock no-error .

export delimiter '¬' JobHead.JobNum JobHead.PartNum ttLaborDtl.EmployeeNum Part.ShortChar01 Part.ShortChar02 Part.ShortChar04 .

End.
 

Cringer

ProgressTalk.com Moderator
Staff member
It's not as easy as just converting it. C# doesn't have direct access to the database, so you can't translate the logic at all. You're going to have to provide a lot more context.
 

DiamondDave

New Member
It's not as easy as just converting it. C# doesn't have direct access to the database, so you can't translate the logic at all. You're going to have to provide a lot more context.

You may be thinking of classic C++, but C# (.NET) has a syntax very similar to ABL. LINQ Example:

BirthdaysToday = from student in studentList where Active=true and DateOfBirth=Today orderby LastName;

I think the real core difficulty of converting ABL to C# is knowing exactly how the ABL parses and compiles code and then converting that to C#. Whoever invents a converter will be rich. ;) Actually the ABL style of LINQ is pretty good (I prefer over Microsoft), so anybody that makes an ABL IDE that is as good as Visual Studio will be richer. The Progress Design studio (or whatever it's called, I gave up on it long ago) looks like it hasn't been updated in decades.
 
Last edited:

DiamondDave

New Member
i am looking for some help to convert this abl to c#. Any help would be greatly welcomed.

Code:
DEF VAR ct AS INTE NO-UNDO.

Output to C:\hardstampdownload\L2.csv .

For each ttLaborDtl where ttLaborDtl.RowMod = 'A' or ttLaborDtl.RowMod = 'U' no-lock:

Find first JobHead where JobHead.Company = ttLaborDtl.Company and JobHead.JobNum = ttLaborDtl.JobNum no-lock no-error .

Find first Part where Part.Company = JobHead.Company and Part.PartNum = JobHead.PartNum no-lock no-error .

export delimiter '¬' JobHead.JobNum JobHead.PartNum ttLaborDtl.EmployeeNum Part.ShortChar01 Part.ShortChar02 Part.ShortChar04 .

End.

If you want it to look just like that, you would need to learn LINQ, which is very similar syntax to ABL. Or if you want to use the classic DAL (Data Access Layer) you would need to learn SQL to write your own queries. I really like the ABL syntax, and have a love/hate relationship with LINQ because Microsoft always breaks stuff! ;) Really, LINQ is also associated with EF (Entity Framework) which for many years had lots of problems, including the learning curve and all the quirks, and sluggishness. As of today, I would always use a DAL with C#, and I really wish there was something as good as Visual Studio for ABL.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Off-topic:
anybody that makes an ABL IDE that is as good as Visual Studio will be richer.
At this point, only PSC can make ABL dev tools and they don't have a great track record. In my ideal outcome, they wouldn't have to. If they did something similar to Project Roslyn with their own compiler, making it a platform and API surface rather than just a bare-bones tool, then we could use IDEs like VS or VS Code and have native ABL compilation, formatting, debugging, code completion, refactoring, static analysis, and other niceties of modern development platforms. Hope springs eternal.
 

DiamondDave

New Member
Off-topic:

At this point, only PSC can make ABL dev tools and they don't have a great track record. In my ideal outcome, they wouldn't have to. If they did something similar to Project Roslyn with their own compiler, making it a platform and API surface rather than just a bare-bones tool, then we could use IDEs like VS or VS Code and have native ABL compilation, formatting, debugging, code completion, refactoring, static analysis, and other niceties of modern development platforms. Hope springs eternal.
Thanks for your reply. I'm going to do some research because not sure 100% what you mean. I guess I'm wondering it's OK for there to be PPP (Progress Programmer's Pal) and such, but not much more. It is frustrating having to resort to message boxes when you want to step thru code.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
If you want to step through code, you can use the debugging perspective in PDSOE. If you don't have that, you can launch the old Java debugger from the Procedure Editor.
 
Top