4 Replies Latest reply on May 24, 2016 11:01 AM by ryan@onf.coop

    How to review all (global) variables in a file

    ryan@onf.coop

      Hey there!

       

      This is my first post within this community, so I apologize if this topic has been covered elsewhere.  I hope I can ask this in a cohesive manner, but, due to my fragmented knowledge, this could become a bit rambly.

       

      I am new to Filemaker (just cutting my teeth on FMP; don't have Advanced yet and am not sure if I need it), and am just starting to dig into scripts / triggers.  When reviewing one of the starter solutions, Assets, I notice that they provide a method for sorting the list view.  When I try to replicate this within my solution (basically I copy-pasted the code), it fails to function, even if I try to locally define one of the variables that seems like it's being called from somewhere else (maybe?).  I think this is happening due to some global variables working behind the scenes that I do not have defined.  I can't find any way to review, in one place, what all variables have been defined within the file, and where they're being used. 

       

      I'm not too concerned about figuring out how to do this specific thing, since I'm guessing it's just a matter of time and research before I understand it.  However, having a way to see every variable in use seems like it would be useful.  Or is there perhaps a better way to determine what various scripts are doing, and what variables they call / increment? 

       

      I hope that at least makes a little sense.  Thanks so much for any insight!

       

      ~Ryan

        • 1. Re: How to review all (global) variables in a file
          jerrysalem

          Ryan

           

          Welcome!

           

          If you are going to be responsible for a database and doing scripting, then you should have FileMaker Advanced.  It will give you a couple things. 

          One, it will let you know what variables (local and global) are being used in a script as it is running.

          You will get the script debugger, which lets you step threw a script as it is running to see what it is doing and trouble shoot.

          Lastly, it gives you the Developer Design Report (DDR).  This thing will let you know where your scripts are being used and what fields are on what layouts.  Plus lots more information.

           

          There are a number of third party DDR analyzers that can do our specific question.  Inspector for example will take a DDR and list all the different variables you are using in a system, and what scripts touch them.

           

          Hope this helps.

          Jerry

          • 2. Re: How to review all (global) variables in a file
            StephenWonfor

            Ryan

             

            Welcome to the Community.  You can see the persistent $$Vars in the Data Viewer in Advanced, and see the $Vars in the Data Viewer when you run your script with the script debugger in Advanced.  You really do need Advanced.

             

            It would be nice to be able to use Get(VariableSpace) in a script to capture current variables but that function does not yet exist in this dimension.  The space between Get(UUID) and Get(WindowContentHeight) could certainly accommodate Get(VariableSpace).  Thus the current need for Advanced.

             

            Stephen

             

            "One man's constant is another man's variable." ~Alan Perlis

            • 3. Re: How to review all (global) variables in a file
              ryan@onf.coop

              Hi Jerry,

               

              Thank you for the response!  I agree now; I now believe Advanced is necessary.  I'll see if I can act on that ASAP.  Thanks again for your help!

               

              ~Ryan

              • 4. Re: How to review all (global) variables in a file
                ryan@onf.coop

                Thank you for your help, Stephen!  I'm sure I'll have plenty more questions on scripting (especially visualizing how to build the whole host of scripts) once I actually get into Advanced.  I appreciate the support. 

                 

                ~Ryan