Board index » delphi » How to store to a memo field in D1?

How to store to a memo field in D1?

Hi,
I have a problem storing a char array to a memo field.
The following code works with Delphi 2:

       FieldByName ('Contact Description').AsString :=
ContactRec.ContactDesc;
        FieldByName ('Contact Action').AsString :=
ContactRec.ContactAction;

where both Contact Description and Contact Actions are arrays of char.
This is part of a conversion program to get the data from a flat file
into a paradox table. I need to be able to convert the data using
Delphi 1 as a lot of potential users run 16 bits.
I would appreciate any help or pointers in getting this data into the
memo fields.

Thanks

.. John

--        --      --        --       --      --       --     --

Internet  jo...@zip.com.au

3.48 Years to total confusion.

 

Re:How to store to a memo field in D1?


Quote
jo...@zip.com.au (John Buxton) wrote:
>Hi,
>I have a problem storing a char array to a memo field.
>The following code works with Delphi 2:

>       FieldByName ('Contact Description').AsString :=
>ContactRec.ContactDesc;
>        FieldByName ('Contact Action').AsString :=
>ContactRec.ContactAction;

[snip]

Since writing this I have found a solution in the code snippet below:

  TS :=TstringList.Create;
  with Contactstable do
  begin
    append;

    Ts.add(ContactRec.ContactDesc);
    FieldByName ('Contact Description').assign (Ts);
    Ts.Clear;
    TS.add(ContactRec.ContactAction);
    FieldByName ('Contact Action').assign (Ts);
    TS.Free;

...
This may not be the most elegant, however it works for the two memo
fields.
One other 'feature' has emerged. When I read the table I am putting
the contents of the two memo fields into DBmemo components, both of
which have word wrap true, however the text is not wrapped. How can I
display the text wrapped?

.. John

--        --      --        --       --      --       --     --

Internet  jo...@zip.com.au

3.48 Years to total confusion.

Other Threads