Page 5 of 7 FirstFirst ... 234567 LastLast
Results 41 to 50 of 63

Thread: Release: Source Code Tools

  1. #41
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    2,573

    Default Re: Release: Source Code Tools

    Excellent. Will try this afternoon. I thought the initialisation might be an issue, but as every program's oApplication contains a procedure that does all that I've never enforced defaults. Belt AND braces...
    test? it compiles doesn't it?

  2. #42
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    2,573

    Default Re: Release: Source Code Tools

    Quote Originally Posted by DaveR View Post
    NP. I'll try again right now.
    Wil,

    Does the latest/current svn version include the Public fix? Still seeing them left untouched.

    Just for giggles I made the following edit and it found more. Trimming sPubPriv does the trick. Obviously could make this prettier...

    Function RemovePropertyPublicPrivate String ByRef sLine String sPubPriv Returns Boolean
    Boolean bChanged
    String sTest sTest1
    Integer iPos


    Move False to bChanged
    Move (Ltrim(sLine)) to sTest
    Move (Left(sTest, 9)) to sTest
    Move (Lowercase(sTest)) to sTest
    Move (Trim(sPubPriv)) to sTest1
    If (sTest = "property ") Begin
    Move (Lowercase(sLine)) to sTest
    //Move (Pos(sPubPriv, sTest)) to iPos
    Move (Pos(sTest1, sTest)) to iPos
    If (iPos>0) Begin
    //Move (Overstrike(Repeat(" ",Length(sPubPriv)),sLine, iPos)) to sLine
    Move (Overstrike(Repeat(" ",Length(sTest1)),sLine, iPos)) to sLine
    Move True to bChanged
    End
    End
    Function_Return bChanged
    End_Function
    Last edited by DaveR; 22-Sep-2018 at 11:17 AM.
    test? it compiles doesn't it?

  3. #43
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    2,573

    Default Re: Release: Source Code Tools

    Another oddity, on begin/end. This was probably run more than once...

    this:
    Code:
                            if (found) dfwritepos ("Total onhand for all Non-Designer Jewelry -" * codemast.description) 0.1 (rgb_blue+font_bold) 0
                            else       dfwritepos "Total onhand for all Non-Designer Jewelry - no (or unknown) primary stone" 0.1 (rgb_blue+font_bold) 0
    became this...

    Code:
            if (found) dfwritepos ("Total onhand Begin
                                for all Non-Designer Jewelry -" * codemast.description) 0.1 (rgb_blue+font_bold) 0
                            End
                            else       dfwritepos "Total onhand Begin
                                for all Non-Designer Jewelry - no (or unknown) primary stone" 0.1 (rgb_blue+font_bold) 0
                            End
    test? it compiles doesn't it?

  4. #44

    Default Re: Release: Source Code Tools

    Dave,

    The latest SVN revision (version 139) does indeed have the patched code, but it does not look like what you have.
    It should look like this:
    Code:
        Function RemovePropertyPublicPrivate String ByRef sLine String sPubPriv Returns Boolean
            Boolean bChanged
            String sTest
            Integer iPos
            Move False to bChanged
            Move (Ltrim(sLine))     to sTest
            Move (Left(sTest, 9))   to sTest
            Move (Lowercase(sTest)) to sTest
            If (sTest = "property ") Begin
                Move (Lowercase(sLine)+" ") to sTest // add a space to the test at the end for if the keyword is at the end of the line.
                Move (Pos(" "+sPubPriv+" ", sTest)) to iPos 
                If (iPos=0) Begin // if there's a tab char instead of a space then..
                  Move (Pos(Character(9)+sPubPriv+" ", sTest)) to iPos
                End  
                If (iPos>0) Begin
                  Move (Overstrike(Repeat(" ",Length(sPubPriv)),sLine, iPos+1)) to sLine // skip first character, don't overwrite a tab with a space
                  Move True to bChanged
                End
            End
          Function_Return bChanged
        End_Function
        Function RemovePropertyPublic String ByRef sLine Returns Boolean
          Boolean bChanged
          Get RemovePropertyPublicPrivate (&sLine) "public" to bChanged
          Function_Return bChanged
        End_Function
        Function RemovePropertyPrivate String ByRef sLine Returns Boolean
          Boolean bChanged
          Get RemovePropertyPublicPrivate (&sLine) "private" to bChanged
          Function_Return bChanged
        End_Function
    As you can see trimming sPubPriv doesn't do anything anymore as I removed the spaces from the " public " and " private " parameters and instead add them back when testing.

    There's one more possible case untested, if you have a tab character behind the public/private keyword, but it should not have problems with the public/private keyword being the last word on your line.

    --
    Wil

  5. #45

    Default Re: Release: Source Code Tools

    Eww.. nasty.

    Logged as: https://projects.vdf-guidance.com/issues/119

    --
    Wil

  6. #46
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    2,573

    Default Re: Release: Source Code Tools

    Quote Originally Posted by wila View Post
    Eww.. nasty.

    Logged as: https://projects.vdf-guidance.com/issues/119

    --
    Wil
    test? it compiles doesn't it?

  7. #47
    Join Date
    Feb 2009
    Location
    Cayman
    Posts
    2,573

    Default Re: Release: Source Code Tools

    It’s possible I may have checked out into a non-empty folder as I was trying to kept the older version for comparison. Manana.
    test? it compiles doesn't it?

  8. #48
    Join Date
    Feb 2009
    Location
    Round Lake, IL
    Posts
    1,742

    Default Re: Release: Source Code Tools

    I found a small bug. I deselected all checkboxes except for "Report Unused Local Variables"

    It still cleaned the Studio Markers.

    I think I found out why...

    This code in CleanMarkers.vw
    Code:
        
        Procedure ReadSettings        Boolean bChecked
            tCleanupActions CleanupActions
          
            Get Checked_State of oCreateBackupFiles_cb to bChecked
            Set pbCreateBackupFile to bChecked
          
            Move (Checked_State(oCreateBackupFiles_cb))  to CleanupActions.bRemoveMarkers
            Move (Checked_State(oRTrimLines_cb))         to CleanupActions.bRTrimLines
            Move (Checked_State(oRemoveLocals_cb))       to CleanupActions.bRemoveLocal
            Move (Checked_State(oRemoveFonts_cb))        to CleanupActions.bRemoveFonts
            Move (Checked_State(oIfElseSemiColumn_cb))   to CleanupActions.bInlineIfElse
            Move (Checked_State(oPropertyPublic_cb))     to CleanupActions.bPropertyPublic
            Move (Checked_State(oPropertyPrivate_cb))    to CleanupActions.bPropertyPrivate
            Move (Checked_State(oRemoveEndComments_cb))  to CleanupActions.bRemoveEndComments
            Move (Checked_State(oReportUnusedLocals_cb)) to CleanupActions.bUnusedLocals
    
            Set pCleanupActions to CleanupActions
        End_Procedure
    ...should be this
    Code:
        Procedure ReadSettings
            Boolean bChecked
            tCleanupActions CleanupActions
          
            Get Checked_State of oCreateBackupFiles_cb to bChecked
            Set pbCreateBackupFile to bChecked
          
            Move (Checked_State(oRemoveMarkers_cb))  to CleanupActions.bRemoveMarkers
            Move (Checked_State(oRTrimLines_cb))         to CleanupActions.bRTrimLines
            Move (Checked_State(oRemoveLocals_cb))       to CleanupActions.bRemoveLocal
            Move (Checked_State(oRemoveFonts_cb))        to CleanupActions.bRemoveFonts
            Move (Checked_State(oIfElseSemiColumn_cb))   to CleanupActions.bInlineIfElse
            Move (Checked_State(oPropertyPublic_cb))     to CleanupActions.bPropertyPublic
            Move (Checked_State(oPropertyPrivate_cb))    to CleanupActions.bPropertyPrivate
            Move (Checked_State(oRemoveEndComments_cb))  to CleanupActions.bRemoveEndComments
            Move (Checked_State(oReportUnusedLocals_cb)) to CleanupActions.bUnusedLocals
    
    
            Set pCleanupActions to CleanupActions
        End_Procedure
    Todd Forsberg
    Idealease, Inc.
    Senior Programmer

    Web and Mobile Development: Think Outside the <DIV>

  9. #49

    Default Re: Release: Source Code Tools

    Hi Todd,

    Thanks, nice catch.
    Checked your suggested change in.
    The fix will be in the next update.
    --
    Wil

  10. #50
    Join Date
    Oct 2013
    Location
    Nässjö Sweden
    Posts
    392

    Default Re: Release: Source Code Tools

    Quote Originally Posted by wila View Post
    Hi,

    While finishing up one of the last commits to the Cleanmarkers project I got to chat a bit with Nils from https://www.rdctools.com/.

    He mentioned that he had devised a new tool based on some of the existing code refactoring tools already out there made by several other developers. (Notably the "find unused variables tool" made by Bob Worsley and the "code indenter" from Chris Spencer)

    Nils then send me his project and after playing a bit with it, I really did see the potential for having a tool like this.
    Especially after I played a bit with the code and managed to import the scintilla editor into this tool (hopefully more on that in later releases)

    Over the past month we both tweaked it a bit more and today is the first release, which you can find here:

    http://projects.vdf-guidance.com/pro...rce-code-tools

    Hope you all like it.

    cheers!
    --
    Wil
    This is great.
    One issue, If you have "#IFDEF Is$WebApp" in your code the reindent function flips out.
    I had procedures starting 8 TABS to the right in a pkg file.
    Software Developer Prosmart System AB
    www.prosmart.se

Page 5 of 7 FirstFirst ... 234567 LastLast

Posting Permissions

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