PROCEDURE NestedBlocks:
Outer-Block: FOR EACH Customer WHERE CustNum < 5: ASSIGN Customer.Name = "changed_" + Customer.Name. Inner-Block: FOR EACH Order OF Customer: DISPLAY OrderNum. /* Nonsense code tests for application error. */ IF SUBSTRING(Customer.Name, 1, 8) EQ "changed_" THEN UNDO, RETURN ERROR. END. END. DISPLAY "For Blocks Complete". END PROCEDURE. RUN NestedBlocks. DISPLAY "Procedure NestedBlocks Complete." |