No announcement yet.

Viewing individual subs and functions

  • Filter
  • Time
  • Show
Clear All
new posts

  • Viewing individual subs and functions

    I was wondering if there was a means of viewing single subs or functions in the IDE. This was a very handy technique in MSBasic 7.0 and its variants. If you are not familiar with this feature, you just hit a hot key and a list of sub and functions would pop up. A double click brought up the desired routine. You could have two routines visible in a split window, but I seldom used that feature.

    This allowed me to quickly analyze interactions between various routines while keeping the lines of code on the screen down to something reasonable. Right now I'm looking at about 3000 lines and it's a bit of a pain. I expect to eventually have about 30,000 lines and that would become just about impossible on a single screen.

  • #2
    Press F2 ...
    "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.


    • #3
      Greetings Arthur!

      That is a feature that I enjoyed back then too. I currently use the SED program that Jose and others worked on (with Lynx of course). It allows code folding so you don't see everything at once. The code is still there; just not as visible. I think that Firefly has the ability to only view one SUB or FUNCTION at once.
      Donnie Ewald
      [email protected]


      • #4
        Hi Earl!

        I second Don's recommendation about the Lynx Project Explorer. As soon as I start working on a project that is more than a template containing a couple hundred lines of code, I create a Lynx project. I dock the Lynx Project Explorer at left in my Window, and attach Jose's SED or Paul's JellyFish right. Then with one click on a procedure name always visible at left in a TreeView in Lynx, you can immediately jump to any procedure. Awesome! In one fell swoop you'll increase your productivity 20%.



        • #5

          I just wanted to say thanks for your comments, and encourage more posters to say "This is what I do ...".

          A lot of us are interested in hearing how other programmers handle their work flow - what tools they use, what tricks of the trade that make them more productive.


          • #6
            Within the scope of the PB IDE, you have several options as well as individual coding style. F2 has been mentioned, and is very useful. And there are bookmarks as well. It has been submitted to PB to have a future capability to have bookmarks saved and restored when app code is unloaded or loaded.

            In addition to that, I tend to try and group related functions in include files. A related technique is to move proven functions to include files and not reload every time. This is where you can easily use the new project options to have a rudimentary control over that facet of the loaded code as well.

            Another submitted improvement would be to have application and/or loaded files wide search and replace functions. There was a post for a free editor that handles multiple languages, acts as a notepad replacement and does do the loaded files search and replace. It's not installed yet on this system, but IIRC it was a topic in the Cafe forum within the last year or so. I don't know if anyone got around to creating files that this editor would use for PB syntax and help though.
            Rick Angell


            • #7
              While I'm sure there are other ways, I find Jellyfish and Lynx to be a great solution.

              The F2 key in the PBCC editor is good, but Lynx also shows you the labels:

              The main reason I use Jellyfish is too many years of hitting Alt-S F)ind or Alt-S R)eplace. My fingers just do that without me thinking about it. When I use PBCC, I end up typing 'f' and 'r' all over the code.

              (Now someone will come in here and tell me that can be configured...)

              The debug is very much easier to use inside PBCC, but that one search function is critical to my navigation.

              My program is nearly 7,000 lines now and very manageable with bookmarks, and the lynx side window.


              • #8
                It is not hard to write a PB application which does something like F2 does and then pops up a textbox containing the code for the sub/function selected. A number of resizeable, draggable read-only text boxes could be kept on the desktop. By using a custom viewer control, syntax highlighting can be added. However, the value in such an application would be in having synchronisation with the source code itself, either the version in the PBEdit control itself or - perhaps more practically - the last saved version.

                I don't know if there is a trick to execute external code when compiling, but if not, you could do it by checking the directory entry of the source code file every 250mS to see if an update was required.

                The update would comprise rebuilding the F2 listview and re-extracting the SUB or FUNCTION code, or closing the code viewer if the SUB/FUNCTION name no longer existed.