5 Replies Latest reply on Oct 7, 2012 6:00 PM by datastride

    Searching code

    pedantic

      Hi everyone.

       

      I am almost 100% positive that this is the wrong forum for this question, but I saw nothing closer to the basic subject of my question, so forgive me for intruding here. If I saw a "Scripting IDE" group then this is where I would ask my question, but I didn't see anything like that so here I go...

       

      I have taken over a project with perhaps 2000+ lines of code. Somewhere in that mass a single global field is set to a particular, important value, and I need to find it. I have tried the good old Mark 1 Mod 0 eyeball search to find that location, but after the first five hundred lines of code or so, my eyes glaze over.

       

      I have also set a watch on the variable and run the debugger to see if I could find where it changes when the program is run and that technique did not work either.

       

      I can find no script search facility in the Script Manager, either for individual scripts, or for all the scripts in the database. Does one exist?

       

      And if the answer is "no" is there some technique that I can use that will help me find any and all interactions with that global variable?

        • 1. Re: Searching code
          DavidZakary

          Go 3rd party.

           

          Take a look at Base Elements, Inspector and Developer Assistant.

          • 2. Re: Searching code
            jimfeuerstein

            Two methods I use, one free and one paid:

             

            BaseElements, which is a great tool for other purposes.

             

            Print to PDF and then search the PDF.

            • 3. Re: Searching code
              beverly

              + on both methods! I print amap (as much as possible) when debugging. PDF is a very searchable way without corning the market on ink and giving my kids an overload of Scratch paper.

               

              I keep some versions back as I make major changes. I have to re-enter from the PDF copy, but if I find I really needed that variable set-just-so my bacon is saved.

               

              I also run DDRs, but the PDFs have their different advantages.

               

              -- sent from my iPhone4 --

              Beverly Voth

              --

              • 4. Re: Searching code
                comment

                You could print out the script to PDF, then search that.

                If you have the Advanced version, you can produce a DDR of all scripts at once. You can search the DDR directly, without using a third-paty DDR tool.

                • 5. Re: Searching code
                  datastride

                  David mentioned the Deverloper Assistent product. I would HIGHLY recommend this plug-in (from Dracoventions) for your development machine. You can search one script or all your scripts in a single step. The plug-in is pretty inexpensive, will save you a massive amount of time, and will help ensure you don't overlook something. In my case, the plug-in paid for itself the first day I used it.

                   

                  Anytime I'm working in a database, I just use a special keystorke sequence to pop up the dialog box that lets me start a search for any string in one or more scripts ... or in the field definitions of a table ... etc.

                   

                  Here's a link to more details:

                   

                       http://www.dracoventions.com/products/2empowerFM/family/developer.php

                   

                  They've got a free trial ... Get it!