Strings and PChars (Was: New GPC beta: gpc-971001)_(re)

Mon, 13 Oct 1997 09:55:39 +0100 (BST)


On Mon, 13 Oct 1997 02:36:00 +0200 Frank Heckenbach  
wrote:
>
>> >>   Str2pChar := StrNew ( StrCopy ( @s [1], @s[1] ) );
>> >
>> >I don't understand this line. What do you expect "StrCopy ( @s [1], @s[1] )"
>> >to do? AFAICS, it copies a string into itself!?
>>
>> More or less. Since it is already itself, nothing really should happen,
>> but the side effect is that it provides the input for StrNew to work with,
>
>You could just write "Str2pChar := StrNew ( @s[1] );" 

True.

>which gives the same (wrong) result in BP.

Now, that is the interesting bit. Both permutations give a wrong result
in BP (DOS real mode and DOS DPMI), but give correct results in
BP (Windows) and GPC (DJGPP). Shouldn't they all behave the same?

Best regards, The Chief
Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant)
Author of:  Chief's Installer Pro v4.01 for Win16 and Win32.
Homepage:  http://ourworld.compuserve.com/homepages/African_Chief/
E-mail: laa12@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