Оказалось, что Прогресс не выдает ошибку если типы передаваемых параметров не соответствуют их описанию и просто их конвертит:
run TestSum(1, 2). /* Shows 12 */
PROCEDURE TestSum:
def input param sNum1 as char.
def input param sNum2 as char.
message "SUM = " (sNum1 + sNum2). .
end procedure.
Не нашел описание этого в документации, надо ли менять такие ошибки в коде (добавлять явную конверсию), вдруг в следующей версии это вылетит?
Спасибо
Неявная конвертация input параметров
Re: Неявная конвертация input параметров
В документации на RUN написано:
Parameters must be defined in the called procedure. (See the DEFINE PARAMETER statement reference entry.) They must be passed in the same order as they are defined, and they must have compatible data types. The AVM attempts to convert values for data types that do not match. If the AVM cannot convert the value for a mismatched data type, the RUN statement fails with an error condition.
Parameters must be defined in the called procedure. (See the DEFINE PARAMETER statement reference entry.) They must be passed in the same order as they are defined, and they must have compatible data types. The AVM attempts to convert values for data types that do not match. If the AVM cannot convert the value for a mismatched data type, the RUN statement fails with an error condition.
Re: Неявная конвертация input параметров
Спасибо! Я до этого смотрел документацию на define parameter )