While Debugging old Code ....

Smud

Member
If you try something like this in the Dojo (this is for demonstration only, not serious code);

Code:
FIND Order Where ordernum = 100 no-error.
IF AVAILABLE(Order) THEN DO:
  /* then do lots of processing .... before */
  FOR EACH Orderline OF Order:
      DISPLAY ordernum Linenum Itemnum Price Qty.
  END.
END.

You get as expected, some output if Order 100 exists. Long story short, my buggy code was much larger and between the IF AVAILABLE and the FOR EACH, deleted the Order. I was expecting a run-time error but got nothing. Try this;

Code:
AVAILABLE(Order).
FOR EACH Orderline OF Order:
    DISPLAY ordernum Linenum Itemnum Price Qty.
END.

No output but it compiles and runs, no error. Sort of tells you how to debug and update legacy ABL code, assume nothing, which can be .... tedious.
 
Top