[Lazarus] Making a auto-complete dropdown list

Yan Chengyuan yanchengyuan at gmail.com
Sat Apr 25 11:27:41 CEST 2009


Roland Turcan schrieb:

> TYPE TMyObject =class
>                  private
>                    FHeader:TSomeHeader;
>                    FItems :TSomethingArr;
> 
> ...
> 
> FUNCTION TMyObject.LoadFromStream (Stream:TStream):BOOLEAN;
> ...
>   SetLength (FItems, 0); //!! for testing only -- this line works fine
>   Stream.Read (FHeader, HeaderLen);
>   SetLength (FItems, 0); //!! for testing only -- this line raises an exception
> END;

IMO the problem is HeaderLen. What if you use SizeOf(FHeader) instead?

DoDi




More information about the Lazarus mailing list