OPTI2-Missing "const" for unmodified record parameter

Top  Previous  Next


Missing “const” for unmodified record parameter (OPTI2)


This is a list of all record parameters that you can declare with the const directive, resulting in better performance since the compiler can assume that the parameter will not be changed. Generally, if the parameter is larger than 4 bytes, and it doesn't need to be altered in the subroutine, const is more efficient. Also, it is a good idea to use CONST on parameters that aren't intended to be altered, so the compiler can catch those errors for you.






In this case, the parameter R should have the const directive, since it is never changed in the procedure. The compiler can generate code that is more efficient.


No warning is given for methods that are marked with the "override" directive. This is because they must follow the parameter list that the overridden method has.



See also: