ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Where Am I in RDi?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where Am I in RDi?

    I frequently need to analyze or modify legacy code that has numerous large subroutines. When scrolling through the code and especially when searching for a field name or string within the code, it would be really nice to be able to quickly see what subroutine I landed in. Is there a way to have the outline highlight the subroutine I'm in based on the cursor position, or do I just need to find the previous BegSr opcode?

  • #2
    CTRL-SHIFT-O
    Just make sure you're not on a IF/DO/ENDx, etc.

    Comment


    • #3
      To clarify for anyone with a similar question who finds this post - Ctrl-Shift-O is "Show Block Nesting" (can also be found in Right-Click -> Source)
      It adds arrows next to the sequence numbers that link conditional start statements (IF, DO, BEGSR, etc.) with their corresponding end statements.

      If you use it on a conditional start/end statement it displays arrows for that conditional, and any other conditionals inside it

      If you use it on any other line type of line and you are within a subprocedure or subroutine, it adds arrows for the all conditional statements for the subprocedure/subroutine start/end statements (P-spec B/E, DCL-PROC/END-PROC, BEGSR/ENDSR) and all the conditionals it contains. Then you can just scroll up to where the arrows stop and you will be at the start of the subprocedure/subroutine, so you can see which one it is.

      It's not particularly efficient, but I'm not aware of a better way. I would also really like it if Outline View to auto-highlight the subroutine/subprocedure that the cursor is in

      Comment


      • #4
        Just thought of an alternate method, in case anyone still cares

        Ctrl+Q to set a Quick Mark on the current source line
        Ctrl+F, type "begsr", and click Previous (Tab, Tab, Enter will also do Previous) to find and go to the closest BEGSR above the current source linee - you can now see the subroutine name
        Alt+Q to return to the Quick Mark-ed source line

        Also not ideal, but it's doable entirely from the keyboard


        And you can also use the Quick Mark to return to your source line if you use the Show Block Nesting method

        Comment


        • #5
          Originally posted by Vectorspace View Post
          Ctrl+F, type "begsr", and click Previous (Tab, Tab, Enter will also do Previous) to find and go to the closest BEGSR above the current source linee - you can now see the subroutine name
          I think the FIND/REPLACE function in RDI really sucks. Whenever you press CTRL+F, whatever was in the FIND box from the last search you performed is still there and it starts searching for that. It would be nice if CTRL+F would just give you a "blank" box to key your search argument in instead of starting to search before you even have a chance to key in a search argument and press FIND. I wish they would fix this.

          Comment


          • #6
            Originally posted by gregwga50 View Post

            I think the FIND/REPLACE function in RDI really sucks. Whenever you press CTRL+F, whatever was in the FIND box from the last search you performed is still there and it starts searching for that. It would be nice if CTRL+F would just give you a "blank" box to key your search argument in instead of starting to search before you even have a chance to key in a search argument and press FIND. I wish they would fix this.
            If you don't like the default behavior, just change it. Window=>Preferences. Try "Find Text" under "LPEX Editor".

            Comment


            • #7
              If you have access to Developer Works, here is an RFE you may be interested in voting for:


              Also, if you use continuation in the procedure name on the p spec (e.g. getDefaultPrinter...), CTL/SHIFT/O will not display the subprocedure name.

              Comment


              • #8
                Originally posted by taherte001 View Post
                If you have access to Developer Works, here is an RFE you may be interested in voting for:


                Also, if you use continuation in the procedure name on the p spec (e.g. getDefaultPrinter...), CTL/SHIFT/O will not display the subprocedure name.
                Oops, that's not right!

                Sorry, the page you're looking for cannot be displayed

                Please try again later.




                Regards

                Kit
                http://www.ecofitonline.com
                DeskfIT - ChangefIT - XrefIT
                ___________________________________
                There are only 3 kinds of people -
                Those that can count and those that can't.

                Comment


                • #9
                  A nice list of some of the shortcuts can be found in here http://systemideveloper.com/downloadRSEShortcuts.html (thanks John).
                  Regards

                  Kit
                  http://www.ecofitonline.com
                  DeskfIT - ChangefIT - XrefIT
                  ___________________________________
                  There are only 3 kinds of people -
                  Those that can count and those that can't.

                  Comment


                  • #10
                    Originally posted by jtaylor___ View Post

                    If you don't like the default behavior, just change it. Window=>Preferences. Try "Find Text" under "LPEX Editor".
                    I unchecked the incremental find dialog box and that seems to stop it from beginning the search as soon as I press CRTL+F and gives me time to change the search argument before searching. I don't know how to stop it from being populated with the previous search argument. Guess it doesn't matter so long as I have a chance to change it before the search begins.

                    Thanks for sharing that tip.

                    Comment

                    Working...
                    X