Menu ▾ ▴

#33 TRegistry_TryReadBool/TRegistry_ReadBool: optional ErrorHandling parameter

unread
nobody
2026-10-14
2026-10-14
No

Follow-up to [features:#30].

TRegistry_TryReadBool in u_dzClassUtils returns False for a missing value, but raises for a value it cannot convert: EConvertError from StrToBool for a string that is not a Boolean, and ERegistryException for a value that is neither a string nor an integer. TRegistry_ReadBool(..., _Default) is built on it and raises in both cases too.

Both (all overloads) get the same optional parameter as the TryVar2Xxx functions, _ErrorHandling: TErrorHandlingEnum = ehRaiseException. With ehNoException, TRegistry_TryReadBool returns False and TRegistry_ReadBool returns the Default for such a value.

A key that cannot be opened keeps returning False / the Default as now, see [bugs:#60].

Related

Bug Reports: #60
Feature Requests: #30

Discussion


Log in to post a comment.