Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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 TicketCleanup, 15 years ago

Version: 3.3.6.1

Automatic ticket cleanup.

comment:2 by Jon, 15 years ago

Resolution: Rejected
Status: newclosed

comment:3 by anonymous, 15 years ago

I see this was rejected... Can explain why it was rejected?

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.