TZFields against TFields and DisableZFields Property

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
louis
Expert Boarder
Expert Boarder
Posts: 107
Joined: 02.01.2009, 19:41

TZFields against TFields and DisableZFields Property

Post by louis »

Hello,
  • What is the purpose and the right use of the TZFields, why I must prefer TZFields against the ordinary TFields of Delphi?
  • Why they are not registered on Delphi and from FieldsEditor cannot create permanet TZFields for ZTable or ZQuery?
  • What is the purpose and the right use of the property DisableZFields?
  • Is Safe use TZFields in combination with property DisableZFields = True and viceversa TFields and DisableZFields = False?
Thanks
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: TZFields against TFields and DisableZFields Property

Post by marsupilami »

Hello Louis,
louis wrote: 12.05.2021, 07:48 What is the purpose and the right use of the TZFields, why I must prefer TZFields against the ordinary TFields of Delphi?
The TZFields have two uses: They can interact with Zeos internal data structures directly and are faster that way and consume less memory. Also they have capabilities that extend the capabilities of Delphis TField descandants. The TZDateField can display a value of 2021-05-00 without problems whereas Delphi TDateFIelds cannot do that. Even though this value doesn't make much sense, it is valid in MySQL.
TZTimeField on the other hand can save and display time values with a precision down to micro seconds, which Delphis TTimeField also cannot do.
louis wrote: 12.05.2021, 07:48 Why they are not registered on Delphi and from FieldsEditor cannot create permanet TZFields for ZTable or ZQuery?
As far as I know, it is not possible to register them with Delphis field editor. Maybe we would have to come up with our own field editor for making them available.
louis wrote: 12.05.2021, 07:48 What is the purpose and the right use of the property DisableZFields?
DisableZFields is a define in the Zeos.inc file. If you use this define, Zeos will create normal TField descandants at runtime.
louis wrote: 12.05.2021, 07:48 Is Safe use TZFields in combination with property DisableZFields = True and viceversa TFields and DisableZFields = False?
I assume, it is not possible to use TZFields with DisableZFields enabled because then the TZFields will not be compiled. With DisableZFields it should be safe to use Delphis TField implementations.

Best regards,

Jan
louis
Expert Boarder
Expert Boarder
Posts: 107
Joined: 02.01.2009, 19:41

Re: TZFields against TFields and DisableZFields Property

Post by louis »

marsupilami wrote: 12.05.2021, 10:39 As far as I know, it is not possible to register them with Delphis field editor. Maybe we would have to come up with our own field editor for making them available.
I registered my mxZBooleanField with this statement:

Code: Select all

RegisterFields([TmxZBooleanField]);
TZFields cannot register with this statement?

My TmxZBololeanField is a descendant of TBooleanField that use a Firebird smallint column. It store 0 for False and 1 for True.
I cannot verify if it works with the other databases because I use only Firebird, The same with Lazarus because I dont use it.

It can't be created automatically with FieldsEditor like TZFields, I don't know how to do it, but manually from FieldsEditor.

If you accept i can donate this field. How I can do?

Thanks
Post Reply