Board index » delphi » How to assign data to memo fields?

How to assign data to memo fields?

Hi :

     I want to assign to a field which field data type is memo,

I can assign integer data by this way :

  if Table1.Fields[i].Datatype = ftInteger then
     Table1.Fields[i].AsInteger := 10 ;

But if the data type is ftmemo. How do I do the some function

if Table1.Fields[i].Datatype = ftmemo then
    ( I don't know how to code this line )

like above ?

Sincerely yours

Michael

 

Re:How to assign data to memo fields?


if you are trying to put lines of text in there you can use assign e.g.

if Table1.Fields[i].DataType = ftMemo then
    Table1.Fields[i].Assign(Memo1.Lines);

Steve Griffiths

Quote
Michael wrote:
> Hi :

>      I want to assign to a field which field data type is memo,

> I can assign integer data by this way :

>   if Table1.Fields[i].Datatype = ftInteger then
>      Table1.Fields[i].AsInteger := 10 ;

> But if the data type is ftmemo. How do I do the some function

> if Table1.Fields[i].Datatype = ftmemo then
>     ( I don't know how to code this line )

> like above ?

> Sincerely yours

> Michael

Other Threads