Hi,
On Mon, Nov 04, 2002 at 11:51:21PM +0200, rossati@libero.it wrote:
Vale The test on array of char seem not works for array of four char. Here there is a simple source, whit five test and where one is falling:
program Prx; var a5: array[1..5] of char := '01960'; b5: array[1..5] of char := '01959'; a4: array[1..4] of char := '1960'; b4: array[1..4] of char := '1959'; as: string(4) := '1960'; bs: string(4) := '1959'; begin writeln('Test array of char'); if a5 <= '01959' then writeln('failed! array 5 - costant'); if a5 <= b5 then writeln('failed! array 5'); if a4 <= '1959' then writeln('failed! array 4 - costant'); {above the falling test?} if a4 <= b4 then writeln('failed! array 4'); if as <= bs then writeln('failed! string'); end.
It works fine for me. Consider upgrading the compiler, you use a very old version and that is probably the root of the problem:
Reading specs from c:/fsf/lib/gcc-lib/djgpp/2.952/specs gpc version 20001101, based on 2.95.2 19991024 (release)
Anyway, it is surprising for me that gpc accepts this code at all. Only _packed_ arrays of char should behave like strings, and AFAIK the Borlandish substitute for `value' should be `=', not `:=' (an undocumented feature?).
Emil Jerabek