Begin-End - Compound Only
Categories:
Only use BEGIN..END to enclose compound statements.
Bad code
IF FINDSET THEN BEGIN
REPEAT
...
UNTIL NEXT = 0;
END;
Good code
IF FINDSET THEN
REPEAT
...
UNTIL NEXT = 0;
Bad code
IF IsAssemblyOutputLine THEN BEGIN
TESTFIELD("Order Line No.",0);
END;
Good code
IF IsAssemblyOutputLine THEN
TESTFIELD("Order Line No.",0);
Bad code
IF FINDSET THEN
REPEAT
BEGIN
...
END;
UNTIL NEXT = 0;
Good code
IF FINDSET THEN
REPEAT
...
UNTIL NEXT = 0;
Exception
// Except for this case
IF X THEN BEGIN
IF Y THEN
DO SOMETHING;
END ELSE (not X)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified October 4, 2024: Merge pull request #249 from Busschers/ErrorHandling-ListOfReferenceText (5e76983)
by Arend-Jan Kauffmann