El 26/08/2021 a las 13:05, Michael Van Canneyt via fpc-pascal escribió:


On Thu, 26 Aug 2021, Santi via fpc-pascal wrote:

El 26/08/2021 a las 11:58, Michael Van Canneyt via fpc-pascal escribió:


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 :/

By the way, BytesOf documentation is also misleading

In what sense ?


https://www.freepascal.org/docs-html/rtl/sysutils/bytesof.html
The abstract is  "Return the bytes in a string". Probably you can blame my English, but I think it is ambiguous whether  it must be read as

Return (the bytes (in a string))
or
return (the bytes) -> (in a string)

before reading the function declaration, I thought it was the second case.

better something like "Return the bytes OF a string in an array of bytes TBytes"



Michael.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


--
Saludos
Santi

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to