Recent

Author Topic: TBookmark or TBookmarkStr — the confusion  (Read 5861 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1977
    • http://wiki.lazarus.freepascal.org/User:Zoran
TBookmark or TBookmarkStr — the confusion
« on: May 06, 2013, 11:52:43 am »
The documentation claims that TBookmark is deprecated in favour of TBookmarkStr, but, in the source, TBookmarkStr is the type which is marked deprecated.

The fpc 2.6.2 documentation (see: http://www.freepascal.org/docs-html/fcl/db/tbookmark.html) says that TBookmark is depracated:
Quote
TBookmark

Bookmark type (deprecated)
Further on the same page, you can read (bold by me):
Quote
TBookMark is the type used by the TDataset.SetBookMark method. It is an opaque type, and should not be used any more, it is superseded by the TBookmarkStr type.

However, the source of db unit (fpc 2.6.2) claims quite opposite:
Code: [Select]
  TBookmark = Pointer;
  TBookmarkStr = string deprecated 'TBookmarkStr will disappear in 2.6.3 in favour of TBookmark';

What is the actual status of these two types? Which one should be used?
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12567
  • FPC developer.
Re: TBookmark or TBookmarkStr — the confusion
« Reply #1 on: May 06, 2013, 08:34:28 pm »
TBookmark will stay for sure since it is D2009+ compatible.

Afaik this situation reflects the confusing situation with Delphi where first they steered people towards bookmarkstr (since string and thus managed), but that bit them when they changed the definition of the stringtype, and Embarcadero changed TBookmark to array of byte so that it was also autocleaned.

Currently, FPC 2.6.x leans towards bookmarkstr (older Delphis) and 2.7.x (more D2009+ like) will do both.

 

TinyPortal © 2005-2018