Board index » delphi » Pasting txt in string property limi?

Pasting txt in string property limi?

Hi all,

When pasting String data into a String property of a control the text is
truncated to 255 chars.  Implementing a TStrings property is going to be a
waste of time.  The data being pasted must be a single line without #10 &
#13's.

Any help would be appreciated.

Regards,
    TJL

 

Re:Pasting txt in string property limi?


In article <adt7ei$hj...@ctb-nnrp1.saix.net>, "Tjaart" <tjaa...@telkomsa.net>
writes:

Quote
>When pasting String data into a String property of a control the text is
>truncated to 255 chars.  Implementing a TStrings property is going to be a
>waste of time.  The data being pasted must be a single line without #10 &
>#13's.

An ANSI string (string by default) can have a length up to 2Gb. There must be
some limitation in the string source or your coding of it.

Show some of your code.

Alan Lloyd
alangll...@aol.com

Re:Pasting txt in string property limi?


No much code to show.

TDBGridLooks = class(TPersistent)
    ...
    property ColumnsFromString : String read ReturnColumnSettings write
SetColumns;
end;

procedure TDBGridLooks.SetColumns(const Value: String);
begin
  RestoreColumnSettings(Value);
end;

I tested the behavior by copying a 1000 byte test string into the clipboad.
Pasting into a text editor results in the full string being pasted.  Pasting
into the property in the OI causes the string to be immediately truncated.
I get the same behaviour when attempting to paste the string into the text
property of a TEdit control.  What happened to the massive strings in
Delphi?  Or did I just skip a few pages in my Delphi reference?

Quote
"AlanGLLoyd" <alangll...@aol.com> wrote in message

news:20020608144947.09399.00000078@mb-cp.aol.com...
Quote
> In article <adt7ei$hj...@ctb-nnrp1.saix.net>, "Tjaart"

<tjaa...@telkomsa.net>
Quote
> writes:

> >When pasting String data into a String property of a control the text is
> >truncated to 255 chars.  Implementing a TStrings property is going to be
a
> >waste of time.  The data being pasted must be a single line without #10 &
> >#13's.

> An ANSI string (string by default) can have a length up to 2Gb. There must
be
> some limitation in the string source or your coding of it.

> Show some of your code.

> Alan Lloyd
> alangll...@aol.com

Re:Pasting txt in string property limi?


The property editor just can't handle more than 255 chars, the property
itself will be more than happy to accept a string up to 2gb

Cheers,
Nick

Quote
> I tested the behavior by copying a 1000 byte test string into the
clipboad.
> Pasting into a text editor results in the full string being pasted.
Pasting
> into the property in the OI causes the string to be immediately truncated.
> I get the same behaviour when attempting to paste the string into the text
> property of a TEdit control.  What happened to the massive strings in
> Delphi?  Or did I just skip a few pages in my Delphi reference?

> "AlanGLLoyd" <alangll...@aol.com> wrote in message
> news:20020608144947.09399.00000078@mb-cp.aol.com...
> > In article <adt7ei$hj...@ctb-nnrp1.saix.net>, "Tjaart"
> <tjaa...@telkomsa.net>
> > writes:

> > >When pasting String data into a String property of a control the text
is
> > >truncated to 255 chars.  Implementing a TStrings property is going to
be
> a
> > >waste of time.  The data being pasted must be a single line without #10
&
> > >#13's.

> > An ANSI string (string by default) can have a length up to 2Gb. There
must
> be
> > some limitation in the string source or your coding of it.

> > Show some of your code.

> > Alan Lloyd
> > alangll...@aol.com

Re:Pasting txt in string property limi?


You may have also switched off the "long strings"
with use of compiler directives

because "string" may be interpreted as "shortstring" or "ansistring"
depending on what You decide.

cu
Majkel

Other Threads