Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 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 Changed 13 years ago by TicketCleanup

  • Version 3.3.6.1 deleted

Automatic ticket cleanup.

comment:2 Changed 13 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

comment:3 Changed 13 years ago by anonymous

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.