CStrings_(re)

Mon, 28 Apr 1997 11:15:50 +0100 (BST)


On Sun, 27 Apr 1997 17:34:47 +0200 (MET DST) Peter Gerwinski 
 wrote:
>Hello,
>
>I encountered some problems with Procedures accepting `CString'
>parameters.  When passing a string constant to such a parameter, GPC
>does *not* automatically add a "chr ( 0 )" terminator.
>
>Should it do?  

I personally think so.

>And if so, in which cases?  

"In all cases", I would venture to say.

> We always can explicitly write "foo ( 'bar'#0 );" instead 
>of just "foo ( 'bar' );", so I tend to let things like they are ...

The string constant parameter is something that thinks it is 
(or is pretending to be) a CString. Since CStrings end with a Chr(0), 
it is probably best to make the string constant do so automatically 
- otherwise, its pretensions would be found out very quickly.

Best regards, The Chief 
Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant)
Author of:  Chief's Installer Pro v3.12 for Win16 and Win32.
Homepage:  http://ourworld.compuserve.com/homepages/African_Chief/
E-mail: laa12@cc.keele.ac.uk



The African Chief (laa12@cc.keele.ac.uk)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es