Hello world The following ABL code creates a window with the text "Hello, World!" and a button labelled "OK". DEFINE VARIABLE w AS HANDLE NO-UNDO. CREATE WINDOW w ASSIGN WIDTH = 50 HEIGHT = 5 MESSAGE-AREA = FALSE STATUS-AREA = FALSE. CURRENT-WINDOW = w. DEFINE BUTTON btnOK LABEL "OK" SIZE 12 BY 1.2. FORM "Hello World!" VIEW-AS TEXT AT COL 20 ROW 2 btnOK AT COL 20 ROW 4 WITH FRAME f SIZE 50 BY 5 NO-BOX THREE-D. VIEW FRAME f. ENABLE btnOK WITH FRAME f. WAIT-FOR "CHOOSE" OF btnOK. DELETE OBJECT w. A message-box can be used to achieve the same effect: MESSAGE "Hello World!" VIEW-AS ALERT-BOX INFO BUTTONS OK. The INFO parameter controls the message icons, and can be replaced with ERROR or WARNING for different looks. The most basic "Hello, World" program is: DISPLAY "Hello ".
SQL SELECT equivalent The
SQL statement: SELECT * FROM customer; (along with your chosen language connection and display procedures) can be expressed in Progress / ABL as: FOR EACH customer NO-LOCK: DISPLAY customer. END.
SQL UPDATE equivalent The SQL statement: UPDATE customer SET salesman = 'Fred' WHERE custno = 14; (again, along with your chosen language connection and display procedures) can be expressed in Progress / ABL as: FOR EACH customer WHERE customer.custno = 14 EXCLUSIVE-LOCK: ASSIGN customer.salesman = 'Fred'. END. .. (Some assumptions have been made about indexing, locking and transaction scoping in order to keep this example simple.) Data access in the ABL is record-based, in contrast to the result-set-based processing found in traditional SQL languages. While SQL operations typically act on sets of records, ABL processes one record at a time, similar to using a cursor in SQL. Record-based processing provides a fine-grained locking model, allowing the developer to apply different lock levels (e.g., EXCLUSIVE-LOCK, SHARE-LOCK, or NO-LOCK) when accessing records. This approach can offer predictable memory usage, especially in environments using shared memory connections, where the application and database reside on the same host. In client-server (networked) deployments, however, each record or block of records fetched typically involves a network round trip. For example, with a default prefetch size of 50 records and a network latency of 50 ms, retrieving 1,000,000 records may result in up to 1,000 seconds of latency. This illustrates a potential drawback of record-by-record access in high-latency environments. ==Application areas==