Changeset 219 for trunk/Packages/Common/RegistryEx.pas
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (4 days ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/RegistryEx.pas
r218 r219 1 unit URegistry; 2 3 {$MODE delphi} 1 unit RegistryEx; 4 2 5 3 interface … … 38 36 function ReadFloatWithDefault(const Name: string; 39 37 DefaultValue: Double): Double; 38 function ReadDateTimeWithDefault(const Name: string; DefaultValue: TDateTime): TDateTime; 40 39 function DeleteKeyRecursive(const Key: string): Boolean; 41 40 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; … … 48 47 HKEY_CURRENT_CONFIG, HKEY_DYN_DATA); 49 48 49 50 50 implementation 51 52 51 53 52 { TRegistryContext } … … 112 111 end; 113 112 113 function TRegistryEx.ReadDateTimeWithDefault(const Name: string; 114 DefaultValue: TDateTime): TDateTime; 115 begin 116 if ValueExists(Name) then Result := ReadDateTime(Name) 117 else begin 118 WriteDateTime(Name, DefaultValue); 119 Result := DefaultValue; 120 end; 121 end; 122 114 123 function TRegistryEx.DeleteKeyRecursive(const Key: string): Boolean; 115 124 var … … 135 144 //CloseKey; 136 145 {$ENDIF} 137 Result := inherited OpenKey(Key, CanCreate);146 Result := inherited; 138 147 end; 139 148
Note:
See TracChangeset
for help on using the changeset viewer.