Board index » delphi » PChar is *not* ^Char.
abb...@nici.kun.nl (Gerben Abbink)
![]() Delphi Developer |
Wed, 18 Feb 1998 03:00:00 GMT
|
abb...@nici.kun.nl (Gerben Abbink)
![]() Delphi Developer |
Wed, 18 Feb 1998 03:00:00 GMT
PChar is *not* ^Char.
Hi there,
In all the documents and on-line help that I read about Delphi, it type PChar = ^Char See for instance the on-line help on 'Type PChar'. Well, no so! The following code shows that this is not true: type Str1[3] := 'a'; { this line is ok } So, what is the *real* definition of PChar? Bye, -- Gerben |
Don Beus
![]() Delphi Developer |
Wed, 18 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.Quoteabb...@nici.kun.nl (Gerben Abbink) writes: Regards, |
Duncan Murdo
![]() Delphi Developer |
Thu, 19 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.QuoteIn article <42amb8$...@inet-nntp-gw-1.us.oracle.com> dbeu...@us.oracle.com (Don Beusee) writes: p[i]. In plain $X- mode, PChar really is just ^Char. However, in $X+ mode, it's Duncan Murdoch |
Don Beus
![]() Delphi Developer |
Fri, 20 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.Quotedmurd...@mast.queensu.ca (Duncan Murdoch) writes: array. The $X+ extends the *syntax* to support PChar. If you read the help page on PChar carefully, you will see that I am right. Without extended syntax, you need to define your own PChar type so that the { put these type statements in a shared unit if you like } { now use it } Quote>In plain $X- mode, PChar really is just ^Char. However, in $X+ mode, it's Borland really did not need to do this hack (extended syntax). They could Regards, |
Duncan Murdo
![]() Delphi Developer |
Fri, 20 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.QuoteIn article <42eqeg$...@inet-nntp-gw-1.us.oracle.com> dbeu...@us.oracle.com (Don Beusee) writes: string constant or a zero-based char array as an argument to a function expecting a PChar. Once they were in that state of sin, the rest followed easily. Duncan Murdoch |
Duncan Murdo
![]() Delphi Developer |
Sun, 22 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.QuoteIn article <mac.234.304DA...@zeus.hsrc.ac.za> m...@zeus.hsrc.ac.za (Malcolm Coulter) writes: far as I know pString is ^String, i.e. a pointer to a counted string (*not* null-terminated). Duncan Murdoch |
Malcolm Coult
![]() Delphi Developer |
Sun, 22 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.QuoteIn article <dmurdoch.2780.3049A...@mast.queensu.ca> dmurd...@mast.queensu.ca (Duncan Murdoch) writes: Quote> ... Which is why some people have such trouble with PCHAR in C. Is pStr (or pString depending where you are in Help) exactly the same as PCHAR |
Wai Wo
![]() Delphi Developer |
Wed, 25 Feb 1998 03:00:00 GMT
Re:PChar is *not* ^Char.Quoteabb...@nici.kun.nl (Gerben Abbink) wrote: equivalent. For example, MyPChar1+1 is a valid expression which as far as I know is illegal for any other pointer types. Regards |