Hi Erel,
The code shows peculiar behaviour.
Suppose the subkey "File" does not exist. Assumingly, the variable ex should
be an empty string then. However, any kind of string manipulation
(StrIndexOf, SubString, StrLength, etc.) ends up in a NullReferenceException
error as if variable ex assumed an undefined type.
There is no error thrown if compiled without optimization.
The annoying thing is, error messages show no line number.
B4PPC 6.05, .NET 2, WM6 and PPC2003, as per text book.
Any thoughts you can share, please?
The code shows peculiar behaviour.
Suppose the subkey "File" does not exist. Assumingly, the variable ex should
be an empty string then. However, any kind of string manipulation
(StrIndexOf, SubString, StrLength, etc.) ends up in a NullReferenceException
error as if variable ex assumed an undefined type.
There is no error thrown if compiled without optimization.
The annoying thing is, error messages show no line number.
B4PPC 6.05, .NET 2, WM6 and PPC2003, as per text book.
Any thoughts you can share, please?
B4X:
'Arrays dim'd in Global
Dim ex
Reg.RootKey(Reg.rtCurrentUser)
subKeys()=Reg.GetSubKeyNames("Software\RBSoft")
For i = 0 To ArrayLen(SubKeys())-1
ex=Reg.GetString("Software\RBSoft\" & SubKeys(i),"File")
If StrIndexOf(ex,".exe",0) > -1 Then
lbS.Add(ex & " (" & Reg.GetString("Software\RBSoft\" & SubKeys(i),"FriendlyName") & ")")
alSort.Add(Reg.GetString("Software\RBSoft\" & SubKeys(i),"Path"))
End If
Next