Showing results 1 to 5 of 5

Thread: Exception when accessing user level (possible bug?)

  1. #1
    ptk_mzeh Gast

    Default Exception when accessing user level (possible bug?)

    Hello,

    when I try to get the password level of the current user, like this:

     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

    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:
    Last edited by ptk_mzeh : 18th June 2012 at 08:03

  2. #2
    ptk_mzeh Gast

    Default AW: Exception when accessing user level (possible bug?)

    Sorry, forgot to mention: Using Zenon 7.00 SP0

  3. #3
    Join Date
    20.08.2009
    Posts
    293

    Default Re: Exception when accessing user level (possible bug?)

    Hi,

    it seems like a misbehaviour.
    I could reproduce it and forwarded the issue to our development department.

    Regards,
    Bernhard

  4. #4
    ptk_mzeh Gast

    Default AW: Exception when accessing user level (possible bug?)

    Thanks,

    got any suggestions for workarounds?

  5. #5
    martins Gast

    Default Re: Exception when accessing user level (possible bug?)

    hi,

    can you try to avoid the most significant bits for each level property (31, 63, 95, 127) - so excluding them from the level? Seems to me that this would be the only workaround as they are producing an overflow in the system.

    best regards,
    Martin

Similar Threads

  1. Authorization level
    By davide.galigani in forum zenon Operator
    Replies: 3
    Last Post: 5th February 2019, 09:43
  2. Bug report for <Beckhoff TwinCat NG driver>
    By lephis in forum Drivers
    Replies: 4
    Last Post: 6th March 2012, 10:11
  3. Unhandled Exception STACK_OVERFLOW
    By ptkdennis in forum zenon Operator
    Replies: 1
    Last Post: 16th February 2011, 14:36
  4. Bug
    By westbaaam in forum zenon Energy Edition
    Replies: 3
    Last Post: 11th November 2009, 09:31
  5. How to evaluate the user level a user has in the runtime?
    By markclemens in forum zenon Supervisor
    Replies: 0
    Last Post: 6th November 2007, 17:10

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •