Home

Statements should be on separate lines

Description

    The PowerBuilder code rule "Statements should be on separate lines" states that each statement in a PowerBuilder program should be placed on a separate line. This helps to make the code more readable and easier to debug, as it is easier to identify individual statements when they are on separate lines. Additionally, this rule helps to ensure that any changes made to a particular statement are easily identifiable, as they will be on their own line.

Key Benefits

  • Improved readability: Statements on separate lines make code easier to read, as it is easier to distinguish between different statements.
  • Easier to debug: By having each statement on a separate line, it becomes easier to identify and debug errors.
  • Easier to maintain: By having each statement on a separate line, it becomes easier to make changes or add new statements without affecting the existing code.

 

Non-compliant Code Example

private function string TestFunctionCall (string p)

p = "test"; return p; //Non compliant code (Two statements written in the same line)

end function

Compliant Code Example

private function string TestFunctionCall (string p)

p = "test"; 

return p; //Compliant code

end function
Visual Expert 2023
 VEPBRULE65