BDS - 3.55.01.40 Genero 2.40.03
This code extract shows the issue:
DEFINE l_char CHAR(1),
l_i INTEGER,
l_total DEC(8,2)
-- SCALING and WHENEVER test.......
WHENEVER ERROR STOP
LET l_total = 0
WHILE l_total IS NOT NULL AND l_total < 20000000
LET l_total = l_total + ((MONTH(TODAY)/DAY(TODAY)) * YEAR(TODAY))
DISPLAY 'Total IS (',l_total,')'
END WHILE --
PROMPT 'Finished WHENEVER ERROR Test With Total (',l_total,')' FOR CHAR l_char
WHENEVER ANY ERROR STOP
LET l_total = 0
WHILE l_total IS NOT NULL
LET l_total = l_total + ((MONTH(TODAY)/DAY(TODAY)) * YEAR(TODAY))
DISPLAY 'Total IS (',l_total,')'
END WHILE
In BDS, the WHILE loops have to be terminated - the value of l_total simply increases (the 20,000,000 limit is there in the first loop to cause it to stop so the code will continue with the second test), eventually appearing in scientific notation.
In Genero, and this is documented, once l_total exceeds its scale (precision?) - ie above 999999.99 , it goes NULL in the first loop and then causes the program to stop in the second. IE it works 'correctly'.
The migration here had code without any WHENEVER clause. This then manifested itself in variety of situations - totals , array (subscript) (array bounds checking not being turned on).