Null characters (& string implementation) in gpc

Morton, John John.Morton at
Fri Sep 3 21:36:48 CEST 2010

Bonjour Maurice,

I can't test gpc until I build "Hello world" (or "bug") so your results are  great news for us.

Our problem may have something to do with the FAA library and the way we had to link it to our code.

More likely it's because we have a quite old version of gpc and the problem we encountered was fixed in a subsequent release. 

We'll see if the problem disappears after we rebuild our application using the new version of gpc (once I get it going).


-----Original Message-----
From: gpc-owner at [mailto:gpc-owner at] On Behalf Of Maurice Lombardi
Sent: September 3, 2010 01:29 PM
To: gpc at
Subject: Re: Null characters (& string implementation) in gpc

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';

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 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

More information about the Gpc mailing list