For Hire: Converting to API 2.0

  1. 2 weeks ago

    Josh H

    Feb 11 Pre-Release Testers, Xojo Pro
    Edited 2 weeks ago

    Having just spent the last couple months converting all of my apps, and over 10,000 lines of code to API2.0, I know what a huge pain in the !@#$% it can be. If you have a project you're looking to move to API2.0, give me a shout. US$50/hour. Code you have must compile, error free, as it is. But, I will correct all of the depreciations in your project. I've been working with RealBasic, REALStudio, Xojo since 1999. This arduous task will take you hundreds, if not thousands, of man-hours and detract from the time you have to innovate. Let me do it for you. These tasks cannot be easily performed with a find/replace, and require a human to ensure the conversion is done properly. dev@koingosw.com

    Some examples of API 2 changes:

    Dim F As FolderItem = GetFolderItem("/Users/me/something")
    F.Delete()
    If F.LastErrorCode <> 0 Then
    System.DebugLog("Delete folder item failed: " + Str(F.LastErrorCode))
    End If

    Now becomes:

    Var F As FolderItem = New FolderItem("/Users/me/something",FolderItem.PathModes.Native)
    Try
    F.Remove()
    Catch err As IOException
    System.DebugLog("Delete folder item failed: " + err.Message)
    End Try

    --

    Mid(sFields(n),Len(kQuote)+1,Len(sFields(n))-(Len(kQuote)*2))

    Now Becomes:

    sFields(n).Middle(kQuote.Length,sFields(n).Length-(kQuote.Length*2))

    --

    Left(sFields(n),Len(kQuote)) = kQuote

    Now becomes:

    sFields(n).Left(kQuote.Length) = kQuote

    --

    sFields = Split(sRecords(i),sFieldDelimiter)

    now becomes:

    sFields = sRecords(i).Split(sFieldDelimiter)

    --

    iEnd = uBound(wParent.xBorrowRecords)

    now becomes:

    iEnd = wParent.xBorrowRecords.Count-1

    --

    If InStr(the_string,",") <> 0 Then

    now becomes:

    If the_string.IndexOf(",") <> -1 Then

    --

    Dim d As Date = New Date

    now becomes:

    Var d As DateTime = DateTime.Now()

    --

    ReDim myArray(-1)

    now becomes:

    myArray.ResizeTo(-1)

    --

    Dim varname As VariableType

    now becomes:

    Var varname as VariableType

or Sign Up to reply!