I think the reason StrAlloc is marked as being in decline is just that
explicit creation of PChars is in decline. That's because you can now use
pascal strings (string or AnsiString) in most cases, use SetLength, and pass
PChar(MyString) as needed. But when you do need to create PChars, either
StrAlloc or GetMem will do.
Cheers,
Carl
-----Original Message-----
From: Colin Fraser [mailto:[EMAIL PROTECTED]]
Sent: Monday, 9 October 2000 8:11 AM
To: Multiple recipients of list delphi
Subject: [DUG]: Creating PChars
Hi all...
Just wondering on the use of PChars (when using API calls)...
What is the best way to create and free a string...
Is StrAlloc and StrDispose the way to go, or is GetMem and FreeMem fine...
or doesn't it matter???
Just wondering as in the help it talks about StrAlloc's use being 'in
decline' and StrDispose being there for backward compatibility only.
Any info appreciated,
Regards
Colin
######################################################################
Attention:
The information in this email and in any attachments is confidential.
If you are not the intended recipient then please do not distribute,
copy or use this information. Please notify us immediately by return
email and then delete the message from your computer.
Any views or opinions presented are solely those of the author.
######################################################################
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"