Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread memo and memofields lines problem
Mon, Dec 10 2007 5:05 AMPermanent Link

"Harry de Boer"
LS

I encounter a problem when storing filenames + paths in a memofield (dbIsam
3.3). The line gets seperated when there are spaces in the path (not always
so maybe it's a length problem) . First I write an array of strings
(bestanden) in a Tstringlist (blist) and add this to a memofield

     try
       blist := TstringList.Create;
       for i := 0 to High(bestanden) do begin
         if bestanden[i] <> '' then bList.Add(bestanden[i]);
        end;
       ContactHistorie.FieldByName('Bestand').Assign(bList);
     finally
       blist.Free;
     end;

when I look with dbsys in the memofield 'bestand' it shows 'e:\project
files\verhuur\verhuur 2007\\565_1.pdf' so that seems to be correct. Then
later on I store the value  in a Tmemo (memoBestanden)

 if verhuurdata.contacthistorie['bestand'] <> NULL then
   memoBestanden.Text :=
verhuurdata.contacthistorie.FieldByName('bestand').AsString;

but now the memo has two lines instead of one:
'e:\project files\verhuur\verhuur'
'2007\\565_1.pdf'

Anyone any idea why and how to fix this behaviour?

Regards, Harry

Mon, Dec 10 2007 5:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Harry

I think its a wordwrap problem. AFAIK the only reason a memo field (or TStringList)  will have a new line is a #13#10 pair.

You can test the behaviour yourself.

Drop a TMemo on a form stuff a very long, but shorter than your maximun form width) string with spaces into its Lines property, add shorter lines above and below.

Then just resize the memo and you'll see it wordwrap and unwordwrap.

This behaviour can cause a problem if you return the contents of the TMemo to a field since it will now have CRLF at the wordwrap point (I think)

You should be able to sort it out easily - just set the TMemo's WordWrap to False.

Roy Lambert
Mon, Dec 10 2007 11:39 AMPermanent Link

"Harry de Boer"
Roy,

Thanks. Wordwrap was TRUE; switching it to FALSE did the trick indeed.

Regards, Harry

"Roy Lambert" <roy.lambert@skynet.co.uk> schreef in bericht
news:A3F287BF-CEC7-48F2-BEE9-1712DDD8FD8E@news.elevatesoft.com...
> Harry
>
> I think its a wordwrap problem. AFAIK the only reason a memo field (or
TStringList) will have a new line is a #13#10 pair.
>
> You can test the behaviour yourself.
>
> Drop a TMemo on a form stuff a very long, but shorter than your maximun
form width) string with spaces into its Lines property, add shorter lines
above and below.
>
> Then just resize the memo and you'll see it wordwrap and unwordwrap.
>
> This behaviour can cause a problem if you return the contents of the TMemo
to a field since it will now have CRLF at the wordwrap point (I think)
>
> You should be able to sort it out easily - just set the TMemo's WordWrap
to False.
>
> Roy Lambert
>

Image