Modify ↓
#1874 closed Feature Request (Rejected)
Registry functions should return more meanginful values
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | regread, regwrite, regenumkey, regenumvalue | Cc: |
Description
Along with @error, @extended should tell the reason why the error occured e.g. for RegRead
Failure: Returns "" and sets the @error flag: 1 if unable to open requested key @extended is set to 1 key does not exist 2 read/write permission error 2 if unable to open requested main key 3 if unable to remote connect to the registry -1 if unable to open requested value @extended is set to 1 value does not exist 2 value is empty -2 if value type not supported @extended is set to type of the value $REG_... .
This kind of function could be more usable
Func RegExists($sKey, $sValue = "") Local $iReturn = RegRead($sKey, $sValue) If @error = 1 And @extended = 1 then Return SetError(0, 1, 0) ;key doesn't exist If @error = -1 And @extended = 1 then Return SetError(0, 2, 0) ; value doesnt exist If @error = -1 And @extended = 2 Return 1 ; empty values are fine with us If @error <> 0 And Return SetError(@error, @extended, $iReturn) ; an error occured Return 1 ; the key exists EndFunc
Attachments (0)
Change History (3)
comment:1 by , 15 years ago
| Version: | 3.3.6.1 |
|---|
comment:2 by , 15 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Automatic ticket cleanup.