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

I have considered to convert the TBytes to AnsiString, but instead to doing a research about AnsiString internals, or creating a function that copies bytes in a loop, I supposed that there was already a function to do that. I found BytesOf
https://www.freepascal.org/docs-html/rtl/sysutils/bytesof.html
The abstract is  "Return the bytes in a string", when in fact, according with the text below,  it does the opposite, returns the string in an array of bytes.

Is there any function that move the bytes to an AnsiString?

--
Saludos
Santiago A.

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

Reply via email to