Exception when accessing user level (possible bug?)
Hello,
when I try to get the password level of the current user, like this:
[VBNET] Try
Dim uint_value As UInteger = CType(Me.Project.Passwords.ItemUser(Me.Project.Passwords.LoggedUser).Level, UInteger)
Catch e As Exception
MsgBox(e.StackTrace)
End Try
' or
Try
Dim int_value As Integer = Me.Project.Passwords.ItemUser(Me.Project.Passwords.LoggedUser).Level
Catch e As Exception
MsgBox(e.StackTrace)
End Try[/VBNET]
I always get an error if the last bit is set (in this case, if the user has level 31 set in runtime) - all other levels 1 to 30 work perfectly fine. I get the same error in the Level1(), Level2() and Level3() functions respectively for the values 63, 95, 127.
The error seems to come from the Level() function itself wich returns only a normal Integer instead of a Long or UInt.
Error:

This is a migrated post! Originally posted on 18.06.2012 by user ptk_mzeh. Please be aware that information can be outdated.