[fpc-pascal] Bookmark, TBookmarkStr, TBytes and BytesOf

Michael Van Canneyt michael at freepascal.org
Thu Aug 26 11:58:58 CEST 2021



On Thu, 26 Aug 2021, Santiago A. via fpc-pascal wrote:

> Hello:
>
> Freepascal 3.2.0. Windows 7-32bits
>
> TMyObject=class   private     fDset:TDataset;    function 
> GetBookmark:TBookmarkStr; ... end;
>
> function TMyObject.GetBookmark:TBookmarkStr; Begin   result:=FDset.Bookmark; 
> end;
>
> I get this compiling error:
> Incompatible types: got "TBytes" expected "AnsiString"
>
> Nevertheless, /TbookmarkStr/ documentation example assigns bookmark property 
> to a TBookmarkStr variable
> https://www.freepascal.org/docs-html/fcl/db/tdataset.bookmark.html

The type used for bookmarks changed over time.

You really must use TBookmark.

I have corrected the documentation, it seems the 2 types were switched when
I corrected the documentation when the type actually changed. 
Sorry about that :/

Michael.


More information about the fpc-pascal mailing list