How to replace legacy NewPicture

  1. 2 years ago

    Marc v

    8 Apr 2017 The Netherlands (Limburg)

    A time ago I bought a license for BensListboxExtras (Xojo subclass) from Ben Blake.
    This is a realy great listbox. Thanks to Ben for creating this.

    It is part of my app for years now. The xojo change of newpicture to new picture results in an error in Xojo2016R4 and 2017R1.
    This error is located in the decrypted part of the code. I think it is simple to solve, but I do not have the rights and password to edit the encrypted part.

    Ben Blake is possible not supporting it anymore since the latest version in 2010.
    A few days ago tried to contact Ben by mail. No answer yet. Maybe I do have an old mailaccount.

    Is anyone in contact with Ben? Maybe you can ask him to contact me.
    Or does anybody know if there is someone else supporting this subclass?

  2. Dave S

    8 Apr 2017 Answer San Diego, California USA

    this MIGHT fix it for you.
    add this to a global module in your project

    Public Function newPicture(width as integer,height as integer,depth as integer=-1) as picture
      If depth>0 Then 
        Return New picture(width,height,depth)
      Else
        Return New picture(width,height)
      End If
    End Function
    

    I have NOT tested this... but it might override the old code, and use this function instead.
    worth a shot

  3. Marc v

    8 Apr 2017 The Netherlands (Limburg)

    Thank you. So simple. Shame on me, i didn't think about it

  4. Dave S

    8 Apr 2017 San Diego, California USA

    Seeing as how that worked (I assume), why don't you change the title of this topic to something like "How to replace legacy NewPicture" or something.... this way it might help others in the future for other situations :)

  5. Marc v

    8 Apr 2017 The Netherlands (Limburg)

    I agree!
    thanks a lot!

  6. Peter F

    9 Apr 2017 Pre-Release Testers, Xojo Pro New England

    Find "NewPicture" and replace with "New Picture".

  7. Marc v

    9 Apr 2017 The Netherlands (Limburg)

    @Peter
    Most times replace will work.And it is faster!

    In this case the code is in a password decrypted part. The password is not available. Now this method fixes the problem.

  8. Peter F

    9 Apr 2017 Pre-Release Testers, Xojo Pro New England

    I figured there was something I hadn't considered. Good answer @Dave S :)

  9. Dave S

    9 Apr 2017 San Diego, California USA

    there is no "Z", but thanks :)

or Sign Up to reply!