Hello, folks!
Here is a sketch for a `SetLength' reference section.
Dose somebody know whether this
@samp{SetLength} is a Borland Delphi 1.0 extension.
is really true?
Yours,
Peter
On Mon, 1 Jun 1998, Peter Gerwinski wrote:
Dose somebody know whether this
@samp{SetLength} is a Borland Delphi 1.0 extension.
is really true?
It is definitely true of Delphi 2.0, I'm sure it's true of Delphi 1.0 as well since it's in the System Unit. Here's the text straight out of Delphi 2.0's help:
Unit
System
Declaration
procedure SetLength(var S: string; NewLength: Integer);
Description
The SetLength procedure sets the dynamic length of a string variable. For a short string variable, SetLength simply sets the length indicator character (the character at S[0]) to the given value. In this case, NewLength must be a value between 0 and 255. For a long string variable, SetLength reallocates the string referenced by S to the given new length. Any existing characters in the string are preserved, but the contents of any newly allocated space is undefined. If there is not enough memory available to reallocate the string, an EOutOfMemory exception is raised. Following a call to SetLength, S is guaranteed to reference a unique string, that is a string with a reference count of one.
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414
1-Jun-98 13:31 Peter Gerwinski wrote:
Dose somebody know whether this
@samp{SetLength} is a Borland Delphi 1.0 extension.
is really true?
AFAIK this function was introduced in Borland Delphi 2.0 to provide a compatible way to assign string length for various string types. Delphi 1.0 had only one string type (Borland Pascal style short strings) and didn't have such function.
Yours, -- Marius Gedminas "A Hacker is any person who derives E-mail: mgedmin@pub.osf.lt joy from discovering ways to WWW: http://www-public.osf.lt/~mgedmin circumvent limitations." rab'86
According to Marius Gedminas:
@samp{SetLength} is a Borland Delphi 1.0 extension.
AFAIK this function was introduced in Borland Delphi 2.0 to provide a compatible way to assign string length for various string types. Delphi 1.0 had only one string type (Borland Pascal style short strings) and didn't have such function.
Okay, I corrected it to "a Borland Delphi 2.0 extension" (until further notice;-). Thanks.
Peter