What if you made a 2nd sub which checks this for you?
Code:
Sub Global
key = "Software\My Application"
End Sub
Sub Loadsettings
CheckReg("ServerURL","http://ayvegh.com/~nico/")
End Sub
Sub CheckReg(What,Value)
reg.New1
reg.RootKey(reg.rtCurrentUser)
ErrorLabel(NotCreatedYet)
msgbox("The value is: " & reg.GetValue(key,What))
return
NotCreatedYet: 'creates the subkey if it didn't exist
reg.CreateSubKey(Value,key&"\"&What)
msgbox("The key was created.")
End Sub
BTW you might want to check the code, I'm not sure if
reg.CreateSubKey(Value,key&"\"&What)
is the correct way