Jump to content
Sign in to follow this  
isolation

regread "" values

Recommended Posts

isolation

I use this func for the registy writing

Func _Rw($key,$dst="",$type="",$val="")
    $a=RegWrite($key,$dst,$type,$val)
    MsgBox(0,$a,@error);
    Return string($a)
EndFunc

I use it with

Call("_Rw","HKEY_LOCAL_MACHINE\SOFTWARE\aaa")

The key is created but it returns @error=0 and returns 0

I've already written about "" values in some Reg* functions that return unusual values but with no helpful answers....

Share this post


Link to post
Share on other sites
weaponx

$result = _Rw("HKEY_LOCAL_MACHINE\SOFTWARE\aaa","","REG_SZ")
MsgBox(0,"","@ERROR: " & @ERROR & @CRLF & "$Result: " & $Result)

Func _Rw($key,$dst="",$type="",$val="")
    $a=RegWrite($key,$dst,$type,$val)
    Return SetError(@ERROR,0,$a)
EndFunc

Share this post


Link to post
Share on other sites
isolation

result=0

and at the same time error=0

but only when it's called with 1 argument,

so, by default, the other values are ""

In the help file:

To access the (Default) value use "" (a blank string) for the valuename.

but it returns 0 and error 0 :P

Share this post


Link to post
Share on other sites
ProgAndy

To Write, you always have to specify the type of the value.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
isolation

Yes, but

RegWrite("HKLM\SOFTWARE\aaa,"","","")

if "" for the "help file" is the default value I use it...

Share this post


Link to post
Share on other sites
jvanegmond

Yes, but

RegWrite("HKLM\SOFTWARE\aaa,"","","")

if "" for the "help file" is the default value I use it...

You must set a type.

Share this post


Link to post
Share on other sites
ProgAndy

If you wnat to create a Key without a value, you must not specify any further params!

$result = _Rw("HKEY_LOCAL_MACHINE\SOFTWARE\aaa")
MsgBox(0,"","@ERROR: " & @ERROR & @CRLF & "$Result: " & $Result)
Func _Rw($key,$dst="",$type="",$val="")
    Switch @NumParams
        Case 1
            Local $a=RegWrite($key)
                Return SetError(@ERROR,0,$a)
        Case Else
            Local $a=RegWrite($key,$dst,$type,$val)
                Return SetError(@ERROR,0,$a)
    EndSwitch
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
isolation

Ok, I've understood :unsure:

but if the 2nd,3rd and 4th parameters are all set to the default value... :P

Share this post


Link to post
Share on other sites
jvanegmond

but it's optional....

If it is optional, it means you can specify it or not specify it.

But if you specify it, it must make sense!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.