Null characters (& string implementation) in gpc

Maurice Lombardi Maurice.Lombardi at ujf-grenoble.fr
Fri Sep 3 19:29:20 CEST 2010


Le 03/09/2010 17:23, Morton, John a écrit :
> We have not found a pure (Pascal-only) way to use gpc writeln (etc.)
> statements to send strings that must include null characters (in our
> case as part of a 4 byte binary time). The problem is that the
> implementation of the mapped C/C++ function prematurely terminates a
> message at the null, preventing the message from being transmitted
> properly.
>
I do not understand.
The following test program works as expected:

program bug;
    var s: string[255] = 'hello >'+chr(0)+'< world';
begin
     writeln(s);
end.

there is an unprintable character between the two  > < and
redirecting the output to a file which can be examined with a binary 
editor shows that this character is indeed a null.

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 at ujf-grenoble.fr





More information about the Gpc mailing list