Re: StrPas equals assign?
From: Wayne Niddery [TeamB] (wniddery_at_chaffaci.on.ca)
Date: 01/22/04
- Next message: David Knaack: "Re: I would like suggestions on storing email messages."
- Previous message: Mark Kimball: "Serial port interface: rewriting a BASIC program in Delphi 5"
- In reply to: Florian Teichert: "StrPas equals assign?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Jan 2004 11:59:02 -0500
Florian Teichert wrote:
>
> var aStr: String;
> aPChar: PChar;
>
> 1. aStr := StrPas(aPChar);
> 2. aStr := aPChar;
>
> ... aren't there any possible differences?
Yes, the first simply does the second, so doing the second is slightly more
efficient. The reason the StrPas function (and a few others) exist is
because they were needed in Delphi 1 (16 bit) to convert between asciiz
strings and original Pascal strings. Since Delphi was endowed with long
strings the compiler has been able to generate the correct code and allow
direct assignment between the two. The functions remain for backward
compatibility.
-- Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com) RADBooks: http://www.logicfundamentals.com/RADBooks.html "It is error alone which needs the support of government. Truth can stand by itself." - Thomas Jefferson
- Next message: David Knaack: "Re: I would like suggestions on storing email messages."
- Previous message: Mark Kimball: "Serial port interface: rewriting a BASIC program in Delphi 5"
- In reply to: Florian Teichert: "StrPas equals assign?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|