Q:  How can I tell the length in bytes of a memo field?

Background:  I have been using the memo field and have been using the getTextLen to get the size I need to set my buffer before getting the information out of my large memo field.  However, I have notice, that if the Memo field is larger than 256 character, the getTexLen will return a number only 0-255.  How am I going to set my buffer to use GetTextBuf?

A:  The lines property of a memo field is a TStrings.  You could try something like this:

function GetMemoSize(TheMemo: TObject): integer;
var i: integer;
begin
  result := 0;
  with (TheMemo as TMemo).lines do
    for i := count - 1 downto 0 do
      result := result + length(strings[i]);
end;

This can be called with IntVariable := GetMemoSize(memo1);