many commands have been deprecated

  1. ‹ Older
  2. 8 weeks ago

    Stuart L

    May 17 Tokyo, Japan

    @Sam R You can always create your own Nthfield. Hint: Use instrb

    Instrb - "This item was deprecated in version 2019r2." :)

    Out of the frying pan into the fire?

  3. Tim P

    May 17 Testers, Xojo Pro Rochester, NY
    Edited 8 weeks ago

    @Stuart L An Add method to go with the Remove method on the dictionary would be nice though. :)

    Stick this on a global module in your project, because if it were in the framework it would make many things ten times more complicated than they need to be.

    Public Sub Add(extends toDict as Dictionary, vKey as Variant, assigns vValue as Variant)
      if toDict.HasKey(vKey) then
        dim ex as new UnsupportedOperationException
        ex.Message = "This key exists already, use the Value function."
        raise ex
        
      end
      
      toDict.Value(vKey) = vValue
    End Sub
  4. 7 weeks ago

    Stuart L

    May 17 Tokyo, Japan

    @Tim P Stick this on a global module in your project, because if it were in the framework it would make many things ten times more complicated than they need to be.
    Public Sub Add(extends toDict as Dictionary, vKey as Variant, assigns vValue as Variant) if toDict.HasKey(vKey) then dim ex as new UnsupportedOperationException ex.Message = "This key exists already, use the Value function." raise ex end toDict.Value(vKey) = vValue End Sub

    Thank you - this community is very helpful. :)

  5. Jeff T

    May 18 Midlands of England, Europe

    I'm scared to even start trying to update my code to suit API2

  6. Tim S

    May 18 Testers Canterbury, UK

    I finished mine some time ago. Then again, I've got the time to do it. From about 5000, now just two deprecation warnings left that will go when 2020r1 arrives.

    I've also gotten rid of Text, and all usage of Xojo.XXX. With the new DateTime class, out went my own DateTime subclass of Date to which I'd added SecondsSince1970.

    Yesterday I finally paid attention to the ability of Database.ExecuteSQL and .SelectSQL to accept parameters for Prepare, so out went three of my own methods which did more or less the same.

    I also rethought my socket handling and ended up writing my own method to validate UTF8 which was what allowed me to complete the removal of Text from my app. I think one has to do that sometimes - see Feedback Case #44953 for another example.

  7. David C

    May 18 Testers, Xojo Pro, XDC Speakers Derby, ITM

    @Jeff T I'm scared to even start trying to update my code to suit API2

    Make sure you have a back up and lots of time. The backup is good in case you make a change then forget what the code used to look like. Time is needed because I had 20,000+ deprecations, now down to nought for desktop apps. I have gone from 10,000 errors (forced deprecations) to 3,500 in my main Web 2.0 app. It has taken me a few weeks to convert both Desktop and Web.
    The result is my code is now MUCH cleaner and smaller, and works across Desktop and Web with little difference. I spend a lot of time removing duplicate Desktop/Web code these days.
    My muscle memory is harder to train since I still have some old API 1.0 code I need to maintain for a client. I will have to straddle the API 1.0/2.0 universes for a while.

  8. Tim S

    May 18 Testers Canterbury, UK

    My bottom line is that I'm feeling rather positive about API 2.

or Sign Up to reply!