Generate a procedure listing file
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
To verify how the AVM is scoping the record buffers, you can generate a listing file that contains various information about how ABL or the AVM processes the procedure when you compile or run it.
To do this, use the LISTING option
on the COMPILE statement:
- Save the procedure so that it has a name you can reference: testscope.p.
-
Open another procedure window and enter this
statement:
COMPILE testscope.p LISTING testscope.lis. - Press F2 to run the
COMPILEstatement. - Select to open testscope.lis. You should see
this code:
{} Line Blk -- ---- --- 1 1 FOR EACH Customer NO-LOCK BY Customer.CreditLimit DESCENDING: 2 1 DISPLAY "Highest:" Customer.CustNum Customer.Name Customer.CreditLimit 3 1 WITH 1 DOWN. 4 1 LEAVE. 5 END. 6 7 FOR EACH Customer NO-LOCK WHERE Customer.State = "NH" 8 BY Customer.CreditLimit DESCENDING: 9 1 DISPLAY Customer.CustNum Customer.Name Customer.CreditLimit. 10 END. 11 File Name Line Blk. Type Tran Blk. Label -------------------- ---- --------- ---- ------------------------------- .\testscope.p 0 Procedure No .\testscope.p 1 For No Buffers: sports2020.Customer Frames: Unnamed .\testscope.p 7 For No Buffers: sports2020.Customer Frames: Unnamed
This listing file tells you that line 1 of the procedure starts a FOR block and that this block does not start a transaction. The
next line tells you what you need to know about scoping. The line that reads Buffers: sports2020.Customer tells you that the Customer buffer is scoped to this FOR block and that it used an unnamed frame that is also scoped to that block.
Next you see that another FOR block begins at line 7. The
Customer buffer is also (independently) scoped to
that block and it has its own unnamed frame.
You could construct similar examples using any combination of strong- and
weak-scoped buffer references. For example, here is a variation on the test procedure that
uses a DO FOR block with a strong scope to the Customer buffer:
|
This procedure scopes the Customer buffer to each block in
turn, just as the first example does.