Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Edit component insert bug
Tue, Apr 5 2016 8:46 AMPermanent Link

Matthew Jones



--

Matthew Jones
Tue, Apr 5 2016 8:48 AMPermanent Link

Matthew Jones

Blooming Enter keys! You probably want the detail:

Add a button and a multi-line edit box to a form.

For the button add:

 MultiLineEdit1.Lines.Insert(0, "hello mum");

You will get "Unable to get property 'splice' of undefined or null
reference". Now type a single character in it and click again, all is
good.

--

Matthew Jones
Tue, Apr 5 2016 6:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Add a button and a multi-line edit box to a form.

For the button add:

 MultiLineEdit1.Lines.Insert(0, "hello mum");

You will get "Unable to get property 'splice' of undefined or null reference". Now type a single character in it and click again, all is good. >>

Got it, thanks.  A fix will be in 2.05.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Apr 5 2016 6:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

This is the hot fix:

WebCore unit:

procedure TStringList.InsertString(Index: Integer; const Value: String);
begin
  SetLength(FStrings,0);  <<<< Fix !!!!
  Insert(Value,FStrings,Index);
  Inc(FCount);
end;

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Apr 6 2016 3:38 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> SetLength(FStrings,0);  <<<< Fix !!!!

Just to be sure - that doesn't actually set it to zero length removing
any exiting content does it? Phew. 8-)

--

Matthew Jones
Wed, Apr 6 2016 8:33 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Just to be sure - that doesn't actually set it to zero length removing any exiting content does it? Phew. 8-) >>

Use this instead:

procedure TStringList.InsertString(Index: Integer; const Value: String);
begin
  if (not Assigned(FStrings)) then
     SetLength(FStrings,0);
  Insert(Value,FStrings,Index);
  Inc(FCount);
end;

Tim Young
Elevate Software
www.elevatesoft.com
Image