ABL(4GL) General Code Samples Book

This is the top level book/outline node for some general ABL (formerly known as Progress 4GL) code samples. This includes code snippets, code examples, utility programs, tricks, techniques, and patterns. There are other books and libraries for more specific topics, such as Win32 API programming and OO programming. This book is a more general catch-all.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Writing XML?

Hi,
I'm trying to connect my ERP program with the open source "Gnome Planner" GANTT project program... Gnome Planner usinx XML file format. But unfortunatelly there is not enaugh XML writing document with Progress 4GL on the net.

I have Production tree. I need to add this tree to Gnome Planner node by node.

I can create sample file from Progress 4GL but only one level (stage) ... But I have 10-20 level deep tree...

Any information?

Regards,
Mucip:)


AttachmentSize
SampleXML.zip845 bytes

what version OE?

OE 10.2B05 Linux DB Windows Clients

What version of Openedge are you working with? It makes a big difference, as the later versions have build in commands to write and read XML.


Sorry..

Hi,
Sorry for my mistake... I'm using 10.1B... On Win client. But DB is on Linux server...

I saw this commands but I need to write 10 ore more step deep tree..

Regards,
Mucip:)


example using temp-tables and datasets

from Stefan Drissen on the PEG: -- it's a full example - so see if it works for 10.1B. (I don't have time to see when some of these features were available - but they SHOULD be for 10.1B)

DEFINE VARIABLE cxml AS LONGCHAR NO-UNDO.

DEFINE TEMP-TABLE Customer
FIELD ID AS INTEGER XML-NODE-TYPE "HIDDEN"
FIELD Name AS CHARACTER
.

DEFINE TEMP-TABLE Orders
FIELD Customer_ID AS INTEGER XML-NODE-TYPE "HIDDEN"
FIELD Order_ID AS INTEGER XML-NODE-TYPE "HIDDEN"
.

DEFINE TEMP-TABLE Order
FIELD ID AS INTEGER XML-NODE-TYPE "HIDDEN"
FIELD Product AS CHARACTER
FIELD Price AS DECIMAL
.

CREATE Customer.
ASSIGN
Customer.ID = 5367
Customer.Name = "Some Customer"
.

CREATE Orders.
ASSIGN
Orders.Customer_ID = Customer.ID
Orders.Order_ID = 123
.
CREATE Order.
ASSIGN
Order.ID = Orders.Order_ID
Order.Product = "Widget"
Order.Price = 59
.
CREATE Order.
ASSIGN
Order.ID = Orders.Order_ID
Order.Product = "Something"
.

DEFINE DATASET Customers
FOR Customer, Orders, Order
DATA-RELATION FOR Customer, Orders RELATION-FIELDS( ID, Customer_ID ) NESTED FOREIGN-KEY-HIDDEN
DATA-RELATION FOR Orders, Order RELATION-FIELDS( Order_ID, ID )
NESTED FOREIGN-KEY-HIDDEN
.

DATASET Customers:WRITE-XML( "LONGCHAR", cxml, TRUE ).

MESSAGE STRING( cxml ) VIEW-AS ALERT-BOX.


Not really this?

Hi,
Thanks a lot. But I need to write wml in my own pattern. Because I must use file pattern of GnomePlanner. Gnome Planner has own tree pattern. Any information?...

Regards,
Mucip:)