Problem getting empty registry values

cactus

Member
Licensed User
Longtime User
Hi,

Sorry if it's been covered b4, I've searched but couldn't find an answer. I'm trying to get the contents of a registry value. It's a string value. If it's filled with anything it works as expected, but if it's an empty value the program throws me a .net error.

So far I tried the following:
B4X:
If Registry.GetValue("Blah\Blah\" , "Blubber blob") = "" Then

B4X:
If IsNull(Registry.GetValue("Blah\Blah\" , "Blubber blob")) Then

B4X:
If Registry.GetString("Blah\Blah\" , "Blubber blob") = "" Then

B4X:
If IsNull(Registry.GetString("Blah\Blah\" , "Blubber blob")) Then

All fail, even with the updated RegistryDevice.dll (dated 30-04-2008) that b.t.w. still says it's 2.01

Any help is appreciated, I'm stuck right now.

TIA,

Cheers,
/Cacti
 

cactus

Member
Licensed User
Longtime User
A simple solution will be to have a small method that will call Registry.Getxxx. In this method use ErrorLabel to catch the error.

Hi,

I already found the Errorlabel solution and solved it that way, it works perfectly now.

Thanks anyways,

Cheers,
/Cacti
 
Top