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. The work session is: C:\fsf\pascal>uname -a MS-DOS X6J0B4 8 00 pc C:\fsf\pascal>gpc -v Reading specs from c:/fsf/lib/gcc-lib/djgpp/2.952/specs gpc version 20001101, based on 2.95.2 19991024 (release) C:\fsf\pascal>gpc prx.pas C:\fsf\pascal>a Test array of char failed! array 4 C:\fsf\pascal> Best regards G. Rossati
rossati@libero.it a écrit:
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:
C:\fsf\pascal>gpc -v Reading specs from c:/fsf/lib/gcc-lib/djgpp/2.952/specs gpc version 20001101, based on 2.95.2 19991024 (release)
No more problem with the last version of gpc. (20020910) Please install it. The last binary for djgpp is maintained under the fixed link: http://gnu-pascal.de/contrib/maurice/gpc2953b.zip Maurice -- Maurice Lombardi Laboratoire de Spectrometrie Physique, Universite Joseph Fourier de Grenoble, BP87 38402 Saint Martin d'Heres Cedex FRANCE Tel: 33 (0)4 76 51 47 51 Fax: 33 (0)4 76 63 54 95 mailto:Maurice.Lombardi@ujf-grenoble.fr
Maurice Lombardi wrote:
... snip ...
No more problem with the last version of gpc. (20020910) Please install it. The last binary for djgpp is maintained under the fixed link:
BTW, what (if any) is the corresponding ftp link? -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
CBFalconer wrote:
Maurice Lombardi wrote:
The last binary for djgpp is maintained under the fixed link:
BTW, what (if any) is the corresponding ftp link?
There is no (official) FTP server anymore. Is the HTTP download a problem for you? Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
Frank Heckenbach wrote:
CBFalconer wrote:
Maurice Lombardi wrote:
The last binary for djgpp is maintained under the fixed link:
BTW, what (if any) is the corresponding ftp link?
There is no (official) FTP server anymore. Is the HTTP download a problem for you?
No, just that the ftp is often more convenient. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
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
Emil Jerabek wrote:
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,
If you compile with `--classic-pascal' or `--extended-pascal', GPC will require `packed'. Otherwise, this is not required.
and AFAIK the Borlandish substitute for `value' should be `=', not `:=' (an undocumented feature?).
AFAIR, Peter added `:=' long time ago because it's similar, but not as ambiguous as the Borlandish `='. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (5)
-
CBFalconer -
Emil Jerabek -
Frank Heckenbach -
Maurice Lombardi -
rossati@libero.it