Tip the return value of a method must be checked
This rule is the result of the previous rule, A method must have a return value. If a return value exists, not checking the result might make you ignore an error.
The following is an example of a wrong block of code.
# Let's add a line at the end of a Collection LINES for 'MYORDER' Instance#Local Integer LINE_NOLINE_NO = Fmet MYORDER.ADDLINE("LINES",[V]CST_ALASTPOS)MYORDER.LINES(LINE_NO).PRODUCT="A"MYORDER.LINES(LINE_NO).QUANTITY=1...
The correct code is as follows:
# Let's add a line at the end of a Collection LINES for 'MYORDER' Instance#Local Integer LINE_NOLINE_NO = Fmet MYORDER.ADDLINE("LINES",[V]CST_ALASTPOS)If LINE_NO <> [V]CST_ANOTDEFINEDMYORDER.LINES(LINE_NO).PRODUCT="A"MYORDER.LINES(LINE_NO).QUANTITY=1...Else# Handle the error...Endif