Results 1 to 6 of 6

Thread: DFRefactor and Structs

  1. #1
    Join Date
    Feb 2009
    Location
    Cayman Islands
    Posts
    3,969

    Default DFRefactor and Structs

    DFRefactor removed the guts of a struct

    Code:
            Struct tSaleType
                String SaleType
                Integer Trx
                Number Amount
                Integer NegTrx
                Number NegAmount
                String CrSaleType
                String CashDrwSum
                String Group
                String Blocked
                String TrxFound
            End_Struct
    
    
            tSaleType[] aSaleType
    
    
            String sFileName sCurrency sSalesType sCcy sCrSaleType sGroup sPathWrkKirk1
            Date dDate
    became

    Code:
            Struct tSaleType
            End_Struct
    
    
            tSaleType[] aSaleType
    
    
            String sFileName sSalesType sCcy sCrSaleType sGroup sPathWrkKirk1
            Date dDate

    the struct definition was actually within a procedure, which wouldn't be my approach, but still..

    BTW, I've written something to convert INSERT and REPLACE commends to functions. It is fairly amateurish but it worked. If you want it to plug into dfrefactor you're welcome to try and knock it into shape
    I should be on a beach ...

  2. #2
    Join Date
    Feb 2009
    Location
    Cayman Islands
    Posts
    3,969

    Default Re: DFRefactor and Structs

    I'll add it to the same thread as it's the same pass of DFRefactor, but another odd effect. You can have the sources if you need them
    Code:
      Procedure End_of_Process 
           Integer iRepairType, iHour, iMinute, iStaffCode, iWatchGender, iJobAssignment, iTicketNo
            Integer iWatchBandType, iWatchColour, iWatchCrystal, iWatchCase, iQty, iWatchMovementType
            Integer iWatchCrown, iWatchWaterProof, iWatchBandCondition, iWatchServiceType, iAssignedStaffNo, iPriority
            DateTime dtCurrentDateTime
            String sTime, sStaffNo, sName, sAssignedStaffName, sPrevTicketNo, sShip, sTermID sPathTag
            String sEmail, sAddress1, sAddress2, sCity, sRegion, sPostCodeZip, sCountryCode
            String sFax, sItemDesc, sBrand, sModel sWatchSN, sRcvStaffName, sBarCodeNotes, sWatchColourOtherDesc
            String sRequestedRepair, sNotes, sJobNotes, sBezelType, sDialType, sStatusCode, sStatusDesc
            Number nCustNo, nItemVal, nEstCost, nDepUS, nDepCI
            Boolean bNewCustomer, bUnderWarranty, bReturnRepair, bWatchIsWorking, bOneHourJob
            Integer iPh1CountryCode iPh1AreaCode iPhoneNo iPh2CountryCode iPh2AreaCode iContactNo
            Date dPromisedDate
    
    
            String sJewelrySerial sJewelryGroup sJewelryMetalType sJewelryPriStone sJewelrySecStone
            String sJewelryOthStone sJewelryCondOtherDesc sJewelryReqRprResizeFrom
            String sJewelryReqRprResizeTo sJewelryReqRprOtherDesc
            Boolean bJewelryCondMissingStone bJewelryCondChips bJewelryCondDents
            Boolean bJewelryCondCracks bJewelryCondKinks bJewelryCondOther
            Boolean bJewelryReqRprSoldering bJewelryReqRprStoneReplacement bJewelryReqRprProngs
            Boolean bJewelryReqRprKnotted bJewelryReqRprOther
    
    
            String sOtherLine sOtherGroup sOtherItemOtherDesc sOtherItemCondition sOtherRequestedRepair
    becomes
    Code:
        Procedure End_of_Process
            Integer iTicketNo
            Integer iWatchMovementType
            Integer iPriority
            DateTime dtCurrentDateTime
            String sTime, sTermID sPathTag
            String sCountryCode
            String sModel sWatchColourOtherDesc
            String sStatusDesc
            Number nDepCI
            Boolean bOneHourJob
            Integer iPh1CountryCode iPh1AreaCode iPhoneNo iPh2CountryCode iPh2AreaCode iContactNo
            Date dPromisedDate
    
    
            String sJewelrySerial sJewelryGroup sJewelryMetalType sJewelryPriStone sJewelrySecStone
            String sJewelryOthStone sJewelryCondOtherDesc sJewelryReqRprResizeFrom
            String sJewelryReqRprResizeTo sJewelryReqRprOtherDesc
            Boolean bJewelryCondMissingStone bJewelryCondChips bJewelryCondDents
            Boolean bJewelryCondCracks bJewelryCondKinks bJewelryCondOther
            Boolean bJewelryReqRprSoldering bJewelryReqRprStoneReplacement bJewelryReqRprProngs
            Boolean bJewelryReqRprKnotted bJewelryReqRprOther
    
    
            String sOtherLine sOtherGroup sOtherItemOtherDesc sOtherItemCondition sOtherRequestedRepair
    Is it the commas? Just noticed them...
    I should be on a beach ...

  3. #3
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    11,085

    Default Re: DFRefactor and Structs

    Yep - it's the commas. 19.1 does not like them - though 19.0 & earlier ignored them.
    Garret

    Time for an oldie but goodie:

    "If it ain't broke, you're not trying." - Red Green

  4. #4
    Join Date
    Feb 2009
    Location
    Cayman Islands
    Posts
    3,969

    Default Re: DFRefactor and Structs

    Quote Originally Posted by Garret Mott View Post
    Yep - it's the commas. 19.1 does not like them - though 19.0 & earlier ignored them.
    they don't bother 19.1 compiler or runtime at all... at least in the few example I've found.
    I should be on a beach ...

  5. #5

    Default Re: DFRefactor and Structs

    Dave,

    re. struct. I'm pretty sure this was reported earlier, but I cannot locate it in the bug tracker, so logged it.

    https://projects.vdf-guidance.com/issues/169

    As you guessed.. it is because you are declaring a struct within a method.
    Not sure if we should even want to fix that, but at least it is logged now.

    re. refactoring methods for Insert and Replace to functions.
    Sure you can email it to me.
    Can't promise that I can massage it to merge with DfRefactor, but I will give it a try.

    --
    Wil

  6. #6

    Default Re: DFRefactor and Structs

    Yes, it is the comma's.
    They have other problems (the debugger doesn't like them either IIRC)

    See:
    https://projects.vdf-guidance.com/issues/159

    --
    Wil

Posting Permissions

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