isolation Posted February 26, 2009 Posted February 26, 2009 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....
weaponx Posted February 26, 2009 Posted February 26, 2009 $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
isolation Posted February 26, 2009 Author Posted February 26, 2009 result=0 and at the same time error=0but 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
ProgAndy Posted February 26, 2009 Posted February 26, 2009 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
isolation Posted February 26, 2009 Author Posted February 26, 2009 Yes, but RegWrite("HKLM\SOFTWARE\aaa,"","","") if "" for the "help file" is the default value I use it...
jvanegmond Posted February 26, 2009 Posted February 26, 2009 Yes, butRegWrite("HKLM\SOFTWARE\aaa,"","","")if "" for the "help file" is the default value I use it...You must set a type. github.com/jvanegmond
ProgAndy Posted February 26, 2009 Posted February 26, 2009 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
isolation Posted February 26, 2009 Author Posted February 26, 2009 Ok, I've understood but if the 2nd,3rd and 4th parameters are all set to the default value...
jvanegmond Posted February 26, 2009 Posted February 26, 2009 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! github.com/jvanegmond
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now